[java] simplify Spacing, reduce allocations #89

Merged
foghina merged 1 commits from better_spacing into master 2015-05-15 07:07:57 -07:00
foghina commented 2015-05-15 06:18:38 -07:00 (Migrated from github.com)
  • always resolve spacing in get(), since it's not that expensive and allows us to not allocate a result array
  • allocate for default spacing on demand

cc @lucasr @andreicoman11

- always resolve spacing in `get()`, since it's not that expensive and allows us to not allocate a result array - allocate for default spacing on demand cc @lucasr @andreicoman11
lucasr commented 2015-05-15 06:42:17 -07:00 (Migrated from github.com)

Looks good to me. What was this mDirty about? Do we have tests for Spacing? Maybe add some?

Looks good to me. What was this `mDirty` about? Do we have tests for `Spacing`? Maybe add some?
foghina commented 2015-05-15 06:48:49 -07:00 (Migrated from github.com)

@lucasr mDirty was used in ensureResult() to determine whether recalculating the result array is necessary. No explicit Spacing tests, but the coverage is pretty good from the many many layout tests that implicitly use Spacing for padding and margin. The layout tests already caught a couple of issues while writing this patch and the previous one (#87).

@lucasr `mDirty` was used in `ensureResult()` to determine whether recalculating the result array is necessary. No explicit `Spacing` tests, but the coverage is pretty good from the many many layout tests that implicitly use `Spacing` for padding and margin. The layout tests already caught a couple of issues while writing this patch and the previous one (#87).
lucasr commented 2015-05-15 06:55:27 -07:00 (Migrated from github.com)

👍

:+1:
Sign in to join this conversation.
No description provided.