On Wed, Aug 11, 2010 at 12:56 PM, <jbrosenb...@google.com> wrote:

> I think this makes sense, and would reduce the size of the generated
> code, e.g. "[12,35,123]" vs. "{12:1,35:1,123:1}".  The Cast.canCast()
> methods would have to iterate through the array explicitly to test for
> existence though, instead of a simple object property lookup.  Thoughts?
>  RayC suggested something similar as well.


Hmm, dunno.  The generate size won't change much after compression, I'd
guess.  Hate to have to introduce an O(n) lookup there, but the only way to
know for sure if it's a win would be to test it in real apps.  My suggestion
of int[] was actually based on the current data structure.  Even though that
looks like Object literal syntax, for practical purposes it could
theoretically be treated as a sparse int[].  But that change wouldn't add
anything to your patch except perhaps readability.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to