diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-12-18 02:11:36 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-12-18 02:11:36 +0000 |
commit | fccb146e3fe437b0df1e9c50d4b8e1080ddb4bd9 (patch) | |
tree | 9f2d9fe0267d96a54e541377ffeada3d0bff0d1d /src/google/protobuf/unknown_field_set.h | |
parent | d5cf7b55a6a1f959d1646785f63ca2b62da78079 (diff) |
Massive roll-up of changes. See CHANGES.txt.
Diffstat (limited to 'src/google/protobuf/unknown_field_set.h')
-rw-r--r-- | src/google/protobuf/unknown_field_set.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/google/protobuf/unknown_field_set.h b/src/google/protobuf/unknown_field_set.h index d6ca70fc..84c2e2b6 100644 --- a/src/google/protobuf/unknown_field_set.h +++ b/src/google/protobuf/unknown_field_set.h @@ -66,7 +66,7 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet { ~UnknownFieldSet(); // Remove all fields. - void Clear(); + inline void Clear(); // Is this set empty? inline bool empty() const; @@ -119,6 +119,8 @@ class LIBPROTOBUF_EXPORT UnknownFieldSet { } private: + void ClearFallback(); + vector<UnknownField>* fields_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(UnknownFieldSet); @@ -180,6 +182,12 @@ class LIBPROTOBUF_EXPORT UnknownField { // =================================================================== // inline implementations +inline void UnknownFieldSet::Clear() { + if (fields_ != NULL) { + ClearFallback(); + } +} + inline bool UnknownFieldSet::empty() const { return fields_ == NULL || fields_->empty(); } |