mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-03 21:24:11 +03:00
Swap keys in proper place
Remove unnecessary clear of the hits
This commit is contained in:
parent
86ca434c93
commit
870defa815
|
@ -260,12 +260,10 @@ cdef class StringStore:
|
||||||
if self.hits.count(key) != 0:
|
if self.hits.count(key) != 0:
|
||||||
tmp.push_back(key)
|
tmp.push_back(key)
|
||||||
|
|
||||||
|
self.keys.swap(tmp)
|
||||||
strings = list(self)
|
strings = list(self)
|
||||||
self._reset_and_load(strings)
|
self._reset_and_load(strings)
|
||||||
|
|
||||||
self.keys.swap(tmp)
|
|
||||||
self.hits.clear()
|
|
||||||
|
|
||||||
cdef const Utf8Str* intern_unicode(self, unicode py_string):
|
cdef const Utf8Str* intern_unicode(self, unicode py_string):
|
||||||
# 0 means missing, but we don't bother offsetting the index.
|
# 0 means missing, but we don't bother offsetting the index.
|
||||||
cdef bytes byte_string = py_string.encode('utf8')
|
cdef bytes byte_string = py_string.encode('utf8')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user