File tree 1 file changed +2
-24
lines changed
server/src/main/java/org/elasticsearch/index/fielddata
1 file changed +2
-24
lines changed Original file line number Diff line number Diff line change @@ -631,28 +631,9 @@ public String get(int index) {
631
631
return values [index ].get ().utf8ToString ();
632
632
}
633
633
634
- public BytesRef getBytesValue () {
635
- if (size () > 0 ) {
636
- /**
637
- * We need to make a copy here because {@link BinaryScriptDocValues} might reuse the
638
- * returned value and the same instance might be used to
639
- * return values from multiple documents.
640
- **/
641
- return values [0 ].toBytesRef ();
642
- } else {
643
- return null ;
644
- }
645
- }
646
-
647
634
public String getValue () {
648
- BytesRef value = getBytesValue ();
649
- if (value == null ) {
650
- return null ;
651
- } else {
652
- return value .utf8ToString ();
653
- }
635
+ return count == 0 ? null : get (0 );
654
636
}
655
-
656
637
}
657
638
658
639
public static final class BytesRefs extends BinaryScriptDocValues <BytesRef > {
@@ -672,10 +653,7 @@ public BytesRef get(int index) {
672
653
}
673
654
674
655
public BytesRef getValue () {
675
- if (count == 0 ) {
676
- return new BytesRef ();
677
- }
678
- return values [0 ].toBytesRef ();
656
+ return count == 0 ? new BytesRef () : get (0 );
679
657
}
680
658
681
659
}
You can’t perform that action at this time.
0 commit comments