[CVS nanning] Improved LinkedHashMap
Lecando Shared <[email protected]> Fri, 5 Sep 2003 08:59:13 -0500
| Newsgroups | gmane.comp.java.nanning.devel |
|---|---|
| Message-ID | <200309051359.h85DxDP32653__31789.453890133$1062769725@hogshead.codehaus.org> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>nanning/src/main/org/codehaus/nanning/util</tt></b> on <span id="info">MAIN</span></td></tr>
<tr><td><tt><a href="#file1">LinkedHashSet.java</a></tt></td><td align="right" id="added">+5</td><td align="right" id="removed">-5</td><td nowrap="nowrap" align="center">1.2 -> 1.3</td></tr>
</table>
<pre class="comment">
Improved LinkedHashMap
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">nanning/src/main/org/codehaus/nanning/util<br /></span>
<div class="fileheader"><big><b>LinkedHashSet.java</b></big> <small id="info">1.2 -> 1.3</small></div>
<pre class="diff"><small id="info">diff -u -r1.2 -r1.3
--- LinkedHashSet.java 5 Sep 2003 13:51:14 -0000 1.2
+++ LinkedHashSet.java 5 Sep 2003 13:59:13 -0000 1.3
@@ -63,12 +63,12 @@
</small></pre><pre class="diff" id="context"> }
public boolean addAll(Collection c) {
</pre><pre class="diff" id="removed">- Set newElements = new HashSet(c);
- newElements.removeAll(set);
- if (set.addAll(c)) {
- return list.addAll(newElements);
</pre><pre class="diff" id="added">+ boolean changed = false;
+ for (Iterator i = c.iterator(); i.hasNext();) {
+ Object o = i.next();
+ changed |= add(o);
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- return <span id="removedchars">false</span>;
</pre><pre class="diff" id="added">+ return <span id="addedchars">changed</span>;
</pre><pre class="diff" id="context"> }
public boolean retainAll(Collection c) {
</pre></div>
</body></html>