Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrays #9113

Merged
merged 5 commits into from
Aug 23, 2016
Merged

Arrays #9113

merged 5 commits into from
Aug 23, 2016

Conversation

johnspackman
Copy link
Member

This PR synchronises qx.lang.Array and qx.data.Array and adds a new .replace() method

The intention is to remove clutter that can crop up when dealing with arrays, especially when you are not able to know in advance whether the array is a qx.data.Array or a native array; for example:

if (arr instanceof qx.data.Array)
  arr = arr.toArray();
if (otherArray instanceof qx.data.Array)
  otherArray = otherArray.toArray();
return qx.lang.Array.equals(arr, otherArray);

becomes:

return qx.lang.Array.equals(arr, anotherArray);

Similarly, qx.data.Array.append already supported native arrays as the source array, but other methods like .equals did not.

The .replace method is added because when editing a qx.data.Array it is often desirable to avoid multiple change events caused by adding and removing multiple entries; it's easy to achieve this is by splice-ing in a new array, but it's clunky code that should be kept out of the application.

Also missing unit tests for some methods

normalise qx.data.Array to accept native arrays and qx.data.Arrays where applicable
add missing qx.lang.Array.exclude;
normalise qx.lang.Array methods to support native and data arrays;
added missing unit tests
@coveralls
Copy link

coveralls commented Jul 27, 2016

Coverage Status

Coverage increased (+0.04%) to 55.733% when pulling 79e601c on johnspackman:arrays into 0a763db on qooxdoo:master.

@coveralls
Copy link

coveralls commented Jul 27, 2016

Coverage Status

Coverage increased (+0.05%) to 55.735% when pulling 9d00203 on johnspackman:arrays into 0a763db on qooxdoo:master.

@level420
Copy link
Member

LGTM

@cajus
Copy link
Contributor

cajus commented Aug 12, 2016

☑️ CALL FOR VOTES

@oetiker oetiker added the VOTING label Aug 12, 2016
@coveralls
Copy link

coveralls commented Aug 12, 2016

Coverage Status

Coverage increased (+0.05%) to 55.735% when pulling 1bd5628 on johnspackman:arrays into 0a763db on qooxdoo:master.

@cajus cajus merged commit a1b580e into qooxdoo:master Aug 23, 2016
@cajus
Copy link
Contributor

cajus commented Aug 23, 2016

Two business days have passed. No vote against.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants