Permalink
Browse files

Minor refactoring.

  • Loading branch information...
1 parent be41c1c commit 98d73c9af1a9e77ab49ad1b39452f4f32de77ba9 rstam committed Apr 13, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 Bson/Serialization/BsonClassMapSerializer.cs
@@ -142,15 +142,18 @@ public object Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializ
}
var memberMap = classMap.GetMemberMapForElement(elementName);
- if (memberMap != null && memberMap != classMap.ExtraElementsMemberMap && !memberMap.IsReadOnly)
+ if (memberMap != null && memberMap != classMap.ExtraElementsMemberMap)
{
- DeserializeMember(bsonReader, obj, memberMap);
+ if (memberMap.IsReadOnly)
+ {
+ bsonReader.SkipValue();
+ }
+ else
+ {
+ DeserializeMember(bsonReader, obj, memberMap);
+ }
missingElementMemberMaps.Remove(memberMap);
}
- else if (memberMap != null && memberMap.IsReadOnly)
- {
- bsonReader.SkipValue();
- }
else
{
if (classMap.ExtraElementsMemberMap != null)

0 comments on commit 98d73c9

Please sign in to comment.