diff src/org/eclipse/jetty/io/AbstractBuffer.java @ 1029:4e5e9e3c25b3

remove Buffer.equalsIgnoreCase()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 00:55:20 -0600
parents 6d17a257b03f
children 80cad9086593
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/AbstractBuffer.java	Thu Nov 03 00:23:04 2016 -0600
+++ b/src/org/eclipse/jetty/io/AbstractBuffer.java	Thu Nov 03 00:55:20 2016 -0600
@@ -162,58 +162,6 @@
 		return true;
 	}
 
-	public boolean equalsIgnoreCase(Buffer b)
-	{
-		if (b==this)
-			return true;
-		
-		// reject different lengths
-		if (b.length() != length()) return false;
-
-		// reject AbstractBuffer with different hash value
-		if (_hash != 0 && b instanceof AbstractBuffer)
-		{
-			AbstractBuffer ab = (AbstractBuffer) b;
-			if (ab._hash != 0 && _hash != ab._hash) return false;
-		}
-
-		// Nothing for it but to do the hard grind.
-		int get=getIndex();
-		int bi=b.putIndex();
-		
-		byte[] array = array();
-		byte[] barray= b.array();
-		if (array!=null && barray!=null)
-		{
-			for (int i = putIndex(); i-->get;)
-			{
-				byte b1 = array[i];
-				byte b2 = barray[--bi];
-				if (b1 != b2)
-				{
-					if ('a' <= b1 && b1 <= 'z') b1 = (byte) (b1 - 'a' + 'A');
-					if ('a' <= b2 && b2 <= 'z') b2 = (byte) (b2 - 'a' + 'A');
-					if (b1 != b2) return false;
-				}
-			}
-		}
-		else
-		{
-			for (int i = putIndex(); i-->get;)
-			{
-				byte b1 = peek(i);
-				byte b2 = b.peek(--bi);
-				if (b1 != b2)
-				{
-					if ('a' <= b1 && b1 <= 'z') b1 = (byte) (b1 - 'a' + 'A');
-					if ('a' <= b2 && b2 <= 'z') b2 = (byte) (b2 - 'a' + 'A');
-					if (b1 != b2) return false;
-				}
-			}
-		}
-		return true;
-	}
-
 	public byte get()
 	{
 		return peek(_get++);