db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r489053 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
Date Wed, 20 Dec 2006 11:28:09 GMT
Author: kahatlen
Date: Wed Dec 20 03:28:07 2006
New Revision: 489053

URL: http://svn.apache.org/viewvc?view=rev&rev=489053
Log:
DERBY-2191: Cleanup of FormatableBitSet
Removal of dead code. Patch contributed by Dyre Tjeldvoll.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java?view=diff&rev=489053&r1=489052&r2=489053
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/FormatableBitSet.java
Wed Dec 20 03:28:07 2006
@@ -1050,31 +1050,14 @@
 		if (otherLength > getLength())
 			grow(otherLength); // expand this bit 
 
-		if (otherBit instanceof FormatableBitSet)
-		{
-			// we know the bit ordering, optimize this 
-			FormatableBitSet ob = (FormatableBitSet)otherBit;
-			int obByteLen = ob.getLengthInBytes();
-			for (int i = 0; i < obByteLen-1; i++)
-				value[i] |= ob.value[i];
-
-			// do the last byte bit by bit
-			for (int i = (obByteLen-1)*8; i < otherLength; i++)
-				if (otherBit.isSet(i))
-					set(i);
-		}
-		else
-		{
-			// we don't know the bit ordering, call thru the interface and go
-			// thru bit by bit
-			// this bit impl's length >= other bit's length
-
-			for (int i = 0; i < otherLength; i++)
-			{
-				if (otherBit.isSet(i))
-					set(i);
-			}
-		}
+		int obByteLen = otherBit.getLengthInBytes();
+		for (int i = 0; i < obByteLen-1; i++)
+			value[i] |= otherBit.value[i];
+		
+		// do the last byte bit by bit
+		for (int i = (obByteLen-1)*8; i < otherLength; i++)
+			if (otherBit.isSet(i))
+				set(i);
 	}
 
 	/**



Mime
View raw message