From 1f32380f62a6fe775f2762e9d60bc3620da3451a Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Tue, 18 Jun 2002 04:55:44 +0000 Subject: [PATCH] Descriptors are inequal if one has colorizations and the other doesn't. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1471 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/cast/CharacterDescriptor.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/cast/CharacterDescriptor.java b/src/java/com/threerings/cast/CharacterDescriptor.java index 0ba51b7cd..9faff1c01 100644 --- a/src/java/com/threerings/cast/CharacterDescriptor.java +++ b/src/java/com/threerings/cast/CharacterDescriptor.java @@ -1,5 +1,5 @@ // -// $Id: CharacterDescriptor.java,v 1.7 2002/05/06 18:08:31 mdb Exp $ +// $Id: CharacterDescriptor.java,v 1.8 2002/06/18 04:55:44 shaper Exp $ package com.threerings.cast; @@ -76,19 +76,24 @@ public class CharacterDescriptor return false; } - // if neither has colorizations, we're clear Colorization[][] zations = odesc._zations; if (zations == null && _zations == null) { + // if neither has colorizations, we're clear return true; + + } else if (zations == null || _zations == null) { + // if one has colorizations whilst the other doesn't, they + // can't be equal + return false; } // otherwise, all of the colorizations must be equal as well - int zlength = _zations.length; - if (zlength != zations.length) { + int zlength = zations.length; + if (zlength != _zations.length) { return false; } - for (int i = 0; i < zlength; i++) { - if (!Arrays.equals(_zations[i], zations[i])) { + for (int ii = 0; ii < zlength; ii++) { + if (!Arrays.equals(_zations[ii], zations[ii])) { return false; } }