SOLR-808 -- Write string keys in Maps as extern strings in the javabin format

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@704862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2008-10-15 11:13:46 +00:00
parent eb6e94c679
commit 13eaf6d061
2 changed files with 8 additions and 1 deletions

View File

@ -62,6 +62,8 @@ Optimizations
1. SOLR-374: Use IndexReader.reopen to save resources by re-using parts of the
index that haven't changed. (Mark Miller via yonik)
2. SOLR-808: Write string keys in Maps as extern strings in the javabin format. (Noble Paul via shalin)
Bug Fixes
----------------------

View File

@ -495,7 +495,12 @@ public class NamedListCodec {
throws IOException {
writeTag(MAP, val.size());
for (Map.Entry entry : (Set<Map.Entry>) val.entrySet()) {
writeVal(entry.getKey());
Object key = entry.getKey();
if (key instanceof String) {
writeExternString((String) key);
} else {
writeVal(key);
}
writeVal(entry.getValue());
}
}