Watcher: Remove pre 2.0 compatibility code

This code is not needed anymore in any 2.x version.

Original commit: elastic/x-pack-elasticsearch@8346b0120e
This commit is contained in:
Alexander Reelsen 2016-01-06 13:26:31 +01:00
parent 996a9a9891
commit 9108001c73
1 changed files with 1 additions and 6 deletions

View File

@ -205,12 +205,7 @@ public class WatchStore extends AbstractComponent {
IndexRequest createIndexRequest(String id, BytesReference source, long version) {
IndexRequest indexRequest = new IndexRequest(INDEX, DOC_TYPE, id);
// TODO (2.0 upgrade): move back to BytesReference instead of dealing with the array directly
if (source.hasArray()) {
indexRequest.source(source.array(), source.arrayOffset(), source.length());
} else {
indexRequest.source(source.toBytes());
}
indexRequest.source(source.toBytes());
indexRequest.version(version);
return indexRequest;
}