Remove bad assert. (#11)
We reserve bufmaxlen bytes in the string, but then proceed to push up to bufmaxlen chars. Therefore it is possible that the string will need to reallocate. A different solution would be to reserve 4*bufmaxlen bytes. Removing the assert is probably ok, because the attempt to pre-allocate is just a performance optimization.
This commit is contained in:
parent
e215f546f3
commit
d3b9641125
1 changed files with 0 additions and 1 deletions
|
@ -2230,7 +2230,6 @@ impl<T: Input> Scanner<T> {
|
|||
end = true;
|
||||
break;
|
||||
}
|
||||
assert!(string.len() < string.capacity());
|
||||
string.push(self.input.peek());
|
||||
self.skip_non_blank();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue