From 4f63a5666937bfd4528c460039ddecb5fb63b3ac Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 18 Sep 2013 16:38:37 +0000 Subject: [PATCH] ICU-10180 document that a string trie cannot be empty X-SVN-Rev: 34380 --- icu4c/source/common/unicode/bytestriebuilder.h | 8 +++++++- icu4c/source/common/unicode/ucharstriebuilder.h | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/unicode/bytestriebuilder.h b/icu4c/source/common/unicode/bytestriebuilder.h index f5e62d9a4f6..6bbd8a212bb 100644 --- a/icu4c/source/common/unicode/bytestriebuilder.h +++ b/icu4c/source/common/unicode/bytestriebuilder.h @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 2010-2012, International Business Machines +* Copyright (C) 2010-2013, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: bytestriebuilder.h @@ -71,6 +71,9 @@ public: * Builds a BytesTrie for the add()ed data. * Once built, no further data can be add()ed until clear() is called. * + * A BytesTrie cannot be empty. At least one (byte sequence, value) pair + * must have been add()ed. + * * This method passes ownership of the builder's internal result array to the new trie object. * Another call to any build() variant will re-serialize the trie. * After clear() has been called, a new array will be used as well. @@ -88,6 +91,9 @@ public: * Builds a BytesTrie for the add()ed data and byte-serializes it. * Once built, no further data can be add()ed until clear() is called. * + * A BytesTrie cannot be empty. At least one (byte sequence, value) pair + * must have been add()ed. + * * Multiple calls to buildStringPiece() return StringPieces referring to the * builder's same byte array, without rebuilding. * If buildStringPiece() is called after build(), the trie will be diff --git a/icu4c/source/common/unicode/ucharstriebuilder.h b/icu4c/source/common/unicode/ucharstriebuilder.h index f1ffc4ce4b0..ccfb86e16d1 100644 --- a/icu4c/source/common/unicode/ucharstriebuilder.h +++ b/icu4c/source/common/unicode/ucharstriebuilder.h @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 2010-2012, International Business Machines +* Copyright (C) 2010-2013, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucharstriebuilder.h @@ -70,6 +70,9 @@ public: * Builds a UCharsTrie for the add()ed data. * Once built, no further data can be add()ed until clear() is called. * + * A UCharsTrie cannot be empty. At least one (string, value) pair + * must have been add()ed. + * * This method passes ownership of the builder's internal result array to the new trie object. * Another call to any build() variant will re-serialize the trie. * After clear() has been called, a new array will be used as well. @@ -87,6 +90,9 @@ public: * Builds a UCharsTrie for the add()ed data and UChar-serializes it. * Once built, no further data can be add()ed until clear() is called. * + * A UCharsTrie cannot be empty. At least one (string, value) pair + * must have been add()ed. + * * Multiple calls to buildUnicodeString() set the UnicodeStrings to the * builder's same UChar array, without rebuilding. * If buildUnicodeString() is called after build(), the trie will be -- 2.40.0