Closed GoogleCodeExporter closed 9 years ago
Also, it occurs to me that a frequency() could return a negative value. Perhaps
iteration should halt once Integer.MAX_VALUE elements are seen (ugh), in
keeping with the definition of Collection.size().
Multiset<String> set = HashMultiset.create();
set.add("foo", (Integer.MAX_VALUE / 2) + 10);
System.err.println("Ouch: " + Iterables.frequency(Iterables.concat(set, set),
"foo"));
Original comment by ray.j.gr...@gmail.com
on 27 Aug 2010 at 6:41
To the original point, I'll see what I can do, yes, thanks.
To the second... how long does that program take to run?
It's pretty well-known that a lot of things work poorly once collections get
past 2^31 in size -- for example *Collections*.frequency(). To get the
overflow checking means a lot of extra checks for everyone, and I'm not sure
it's worth it.
Original comment by kevinb@google.com
on 8 Sep 2010 at 6:02
Original comment by kevinb@google.com
on 14 Sep 2010 at 8:55
Original comment by kevinb@google.com
on 18 Jan 2011 at 8:35
Original comment by fry@google.com
on 26 Jan 2011 at 10:26
Original comment by fry@google.com
on 22 Mar 2011 at 7:08
Original comment by fry@google.com
on 23 Mar 2011 at 1:49
Original comment by fry@google.com
on 17 Jun 2011 at 5:48
Original comment by kevinb@google.com
on 11 May 2012 at 8:55
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:15
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:09
Original issue reported on code.google.com by
ray.j.gr...@gmail.com
on 27 Aug 2010 at 6:23