mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
* Fix niggling memory error, which was caused by bug in the way tokens resized their internal vector.
This commit is contained in:
parent
5dcc1a426a
commit
0f6bf2a2ee
|
@ -84,7 +84,7 @@ cdef class Tokens:
|
|||
self.push_back(lexeme._c)
|
||||
|
||||
cdef int push_back(self, LexemeC* lexeme) except -1:
|
||||
if (self.size + 1) == self.length:
|
||||
if (self.length + 1) == self.size:
|
||||
self.size *= 2
|
||||
self.lexemes = <LexemeC**>realloc(self.lexemes, self.size * sizeof(LexemeC*))
|
||||
self.lexemes[self.length] = lexeme
|
||||
|
|
Loading…
Reference in New Issue
Block a user