Added some warnings for illegal DSet operations and added a small
optimization in the process. Previously, we dumped stack on the server if a entry add was illegal but did nothing for update/remove. On the client, we complained for updates and (indirectly) adds, but not removes. Now we complain everywhere. And- as an added bonus, on the server we now do only one binary search for updates and removals. Whee! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3528 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: EntryUpdatedEvent.java,v 1.13 2004/08/27 02:20:20 mdb Exp $
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||
@@ -87,10 +87,8 @@ public class EntryUpdatedEvent extends NamedEvent
|
||||
if (_oldEntry == UNSET_OLD_ENTRY) {
|
||||
DSet set = (DSet)target.getAttribute(_name);
|
||||
// fetch the previous value for interested callers
|
||||
_oldEntry = set.get(_entry.getKey());
|
||||
|
||||
// update the entry
|
||||
if (!set.update(_entry)) {
|
||||
_oldEntry = set.update(_entry);
|
||||
if (_oldEntry == null) {
|
||||
// complain if we didn't update anything
|
||||
Log.warning("No matching entry to update [entry=" + this +
|
||||
", set=" + set + "].");
|
||||
|
||||
Reference in New Issue
Block a user