Move "<different>" text to a constant
authorRichard Fairhurst <richard@systemeD.net>
Mon, 12 Mar 2012 18:48:50 +0000 (18:48 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 12 Mar 2012 18:48:50 +0000 (18:48 +0000)
net/systemeD/halcyon/connection/EntityCollection.as

index ad7f6b8..6607098 100644 (file)
@@ -16,6 +16,7 @@ package net.systemeD.halcyon.connection {
                private var addedToRelationTimer:Timer;
                private var removedFromRelationTimer:Timer;
                private var delayedEvents:Array = [];
+               private static const DIFFERENT:String = "<different>";
 
         public function EntityCollection(entities:Array) {
                        var conn:Connection=entities[0].connection;
@@ -66,20 +67,19 @@ package net.systemeD.halcyon.connection {
                
                private function getMergedTags():Object {
                        //Builds an object with tags of all entities in this collection. If the value of a tag differs or is not set in all entities, value is marked
-                       var differentMarker:String = "<different>";
                        var mergedTags:Object = _entities[0].getTagsCopy();
                        for each(var entity:Entity in _entities) {
                                var entityTags:Object = entity.getTagsHash();
                                for(var key:String in entityTags) {
                                        var value:String = entityTags[key];
                                        if(mergedTags[key] == null || mergedTags[key] != value) {
-                                               mergedTags[key] = differentMarker;
+                                               mergedTags[key] = DIFFERENT;
                                        }
                                }
                                for(var mergedKey:String in mergedTags) {
                                        var mergedValue:String = mergedTags[mergedKey];
                                        if(entityTags[mergedKey] == null || entityTags[mergedKey] != mergedValue) {
-                                               mergedTags[mergedKey] = differentMarker;
+                                               mergedTags[mergedKey] = DIFFERENT;
                                        }
                                }
                        }
@@ -171,7 +171,7 @@ package net.systemeD.halcyon.connection {
                                                if (!relations[rel.id]) {
                                                        relations[rel.id]= { role: role, relation: rel, distinctCount: 0};
                                                } else if (relations[rel.id].role!=role) {
-                                                       relations[rel.id].role="<different>";
+                                                       relations[rel.id].role=DIFFERENT;
                                                }
                                        }
                                        relations[rel.id].distinctCount++;