projects
/
SXSI
/
TextCollection.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Less GetText reallocs
[SXSI/TextCollection.git]
/
CSA.cpp
diff --git
a/CSA.cpp
b/CSA.cpp
index
a86407d
..
0c755f0
100644
(file)
--- a/
CSA.cpp
+++ b/
CSA.cpp
@@
-290,8
+290,10
@@
uchar* CSA::GetText(DocId k) const
k -= textRank; //emptyTextRank->rank(k);
TextPosition i = k;
k -= textRank; //emptyTextRank->rank(k);
TextPosition i = k;
- // FIXME
- string result; //TextPosition j = (*textLength)[k] - 1;
+
+ string result;
+ // Reserve average string length to avoid reallocs
+ result.reserve(n/numberOfTexts);
uchar c = alphabetrank->access(i);
while (c != '\0')
uchar c = alphabetrank->access(i);
while (c != '\0')