~ubuntu-branches/ubuntu/trusty/protobuf/trusty-proposed

« back to all changes in this revision

Viewing changes to src/google/protobuf/extension_set.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-05-31 14:41:47 UTC
  • mfrom: (2.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110531144147-s41g5fozgvyo462l
Tags: 2.4.0a-2ubuntu1
* Merge with Debian; remaining changes:
  - Fix linking with -lpthread.

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
  return iter->second.GetSize();
187
187
}
188
188
 
 
189
FieldType ExtensionSet::ExtensionType(int number) const {
 
190
  map<int, Extension>::const_iterator iter = extensions_.find(number);
 
191
  if (iter == extensions_.end()) {
 
192
    GOOGLE_LOG(DFATAL) << "Don't lookup extension types if they aren't present (1). ";
 
193
    return 0;
 
194
  }
 
195
  if (iter->second.is_cleared) {
 
196
    GOOGLE_LOG(DFATAL) << "Don't lookup extension types if they aren't present (2). ";
 
197
  }
 
198
  return iter->second.type;
 
199
}
 
200
 
189
201
void ExtensionSet::ClearExtension(int number) {
190
202
  map<int, Extension>::iterator iter = extensions_.find(number);
191
203
  if (iter == extensions_.end()) return;