ASF Bugzilla – Attachment 29323 Details for
Bug 53822
performance of IdentityStack.containsAll()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patchFull.diff
patchFull.diff (text/plain), 1.03 KB, created by
Adrian Nistor
on 2012-09-03 18:45:58 UTC
(
hide
)
Description:
patchFull.diff
Filename:
MIME Type:
Creator:
Adrian Nistor
Created:
2012-09-03 18:45:58 UTC
Size:
1.03 KB
patch
obsolete
>Index: src/main/org/apache/tools/ant/util/IdentityStack.java >=================================================================== >--- src/main/org/apache/tools/ant/util/IdentityStack.java (revision 1380262) >+++ src/main/org/apache/tools/ant/util/IdentityStack.java (working copy) >@@ -17,6 +17,9 @@ > */ > package org.apache.tools.ant.util; > >+import java.util.Collection; >+import java.util.IdentityHashMap; >+import java.util.Iterator; > import java.util.Stack; > > /** >@@ -102,4 +105,21 @@ > return -1; > } > >+ public synchronized boolean containsAll(Collection<?> c) { >+ Iterator i = iterator(); >+ IdentityHashMap seen = new IdentityHashMap(); >+ l: >+ for (Object next : c) { >+ if (seen.containsKey(next)) continue; >+ while (i.hasNext()) { >+ Object p = i.next(); >+ seen.put(p, Boolean.TRUE); >+ if (next == p) { >+ continue l; >+ } >+ } >+ return false; >+ } >+ return true; >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 53822
:
29322
| 29323 |
29324