Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

minor string buffer optimization

  • Loading branch information...
commit a33e8a0ff6eafadd8d6eb3d0d1fd7d3159017578 1 parent 684a0cd
@adam-m adam-m authored
View
3  KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java
@@ -145,7 +145,8 @@ public boolean index() throws Ingester.IngesterException {
//encode to bytes to index as byte stream
String extracted;
//add BOM and trim the 0 bytes
- StringBuilder sb = new StringBuilder((int) totalRead + 5);
+ //set initial size to chars read + bom + metadata (roughly) - try to prevent from resizing
+ StringBuilder sb = new StringBuilder((int) totalRead + 1000);
//inject BOM here (saves byte buffer realloc later), will be converted to specific encoding BOM
sb.append(UTF16BOM);
if (totalRead < MAX_EXTR_TEXT_CHARS) {
Please sign in to comment.
Something went wrong with that request. Please try again.