Skip to content

Commit

Permalink
Fix some incorrect uses of transients.
Browse files Browse the repository at this point in the history
  • Loading branch information
amalloy committed Apr 9, 2012
1 parent b06d9d9 commit 7620625
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/protobuf/core/PersistentProtocolBufferMap.java
Expand Up @@ -271,9 +271,9 @@ static protected Object fromProtoValue(Descriptors.FieldDescriptor field, Object
Object k = v.valAt(map_field_by);
PersistentProtocolBufferMap existing = (PersistentProtocolBufferMap) map.valAt(k);
if (existing != null) {
map.assoc(k, existing.append(v));
map = map.assoc(k, existing.append(v));
} else {
map.assoc(k, v);
map = map.assoc(k, v);
}
}
return map.persistent();
Expand All @@ -297,9 +297,9 @@ static protected Object fromProtoValue(Descriptors.FieldDescriptor field, Object
Object v = fromProtoValue(val_field, message.getField(val_field));
Object existing = map.valAt(k);
if (existing != null && existing instanceof IPersistentCollection) {
map.assoc(k, ((IPersistentCollection) existing).cons(v));
map = map.assoc(k, ((IPersistentCollection) existing).cons(v));
} else {
map.assoc(k, v);
map = map.assoc(k, v);
}
}
return map.persistent();
Expand All @@ -315,10 +315,10 @@ static protected Object fromProtoValue(Descriptors.FieldDescriptor field, Object
Boolean exists = (Boolean) message.getField(exists_field);

if (exists) {
set.conj(item);
set = (ITransientSet)set.conj(item);
} else {
try {
set.disjoin(item);
set = set.disjoin(item);
} catch (Exception e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 7620625

Please sign in to comment.