Index: source/common/bytestrieiterator.cpp |
diff --git a/source/common/bytestrieiterator.cpp b/source/common/bytestrieiterator.cpp |
index e50f07c24fee650881a300d2ecef9de3d8b72670..4d04247c4933d0a7ef6255761151b923641b4767 100644 |
--- a/source/common/bytestrieiterator.cpp |
+++ b/source/common/bytestrieiterator.cpp |
@@ -1,3 +1,5 @@ |
+// Copyright (C) 2016 and later: Unicode, Inc. and others. |
+// License & terms of use: http://www.unicode.org/copyright.html |
/* |
******************************************************************************* |
* Copyright (C) 2010-2012, International Business Machines |
@@ -139,7 +141,6 @@ BytesTrie::Iterator::next(UErrorCode &errorCode) { |
} else { |
pos_=skipValue(pos, node); |
} |
- sp_.set(str_->data(), str_->length()); |
return TRUE; |
} |
if(maxLength_>0 && str_->length()==maxLength_) { |
@@ -167,10 +168,14 @@ BytesTrie::Iterator::next(UErrorCode &errorCode) { |
} |
} |
+StringPiece |
+BytesTrie::Iterator::getString() const { |
+ return str_ == NULL ? StringPiece() : str_->toStringPiece(); |
+} |
+ |
UBool |
BytesTrie::Iterator::truncateAndStop() { |
pos_=NULL; |
- sp_.set(str_->data(), str_->length()); |
value_=-1; // no real value for str |
return TRUE; |
} |
@@ -199,7 +204,6 @@ BytesTrie::Iterator::branchNext(const uint8_t *pos, int32_t length, UErrorCode & |
str_->append((char)trieByte, errorCode); |
if(isFinal) { |
pos_=NULL; |
- sp_.set(str_->data(), str_->length()); |
value_=value; |
return NULL; |
} else { |