BytesReference usage to properly work when hasArray is not available
fix spelling in comment, + remove overcautious assert
This commit is contained in:
parent
0f6c24d0c5
commit
1f15c1e7de
|
@ -344,7 +344,6 @@ public class SourceFieldMapper extends AbstractFieldMapper<byte[]> implements In
|
|||
if (!source.hasArray()) {
|
||||
source = source.toBytesArray();
|
||||
}
|
||||
assert source.hasArray();
|
||||
fields.add(new StoredField(names().indexName(), source.array(), source.arrayOffset(), source.length()));
|
||||
}
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ public class FsTranslog extends AbstractIndexShardComponent implements Translog
|
|||
out.seek(size);
|
||||
|
||||
BytesReference ref = out.bytes();
|
||||
// TODO: pass teh BytesReference to the FsTranslogFile and have them optimize writing
|
||||
// TODO: pass the BytesReference to the FsTranslogFile and have them optimize writing
|
||||
if (!ref.hasArray()) {
|
||||
ref = ref.toBytesArray();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue