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

Cleanup Vector2 #114

Merged
merged 2 commits into from
Apr 8, 2015
Merged

Conversation

Fox32
Copy link
Contributor

@Fox32 Fox32 commented Apr 8, 2015

  • Remove duplicate implementation of some operations: they now delegate calls to another other method (e.g. add operator vs add method or length and length2). Inlining should make the whole thing perform as it did before.
  • When a Vector is a argument, only get its storage once.
  • Always access the private storage variable, this is a preparation for a future change.
  • Doc comments.
  • Making the shuffle getters aliases help to reduce the lines of the file, but the impact for Vector2 is quite small compated to Vector4.

Remove duplicate implementation of some operations: they now delegate calls to another other method (e.g. add operator vs add method or length and length2). Inlining should make the whole thing behave as it did before.
When a Vector is a argument, only get its storage once.
Always access the private storage variable, this is a preparation for a future change.
Doc comments.
@Fox32 Fox32 mentioned this pull request Apr 8, 2015
@@ -6,7 +6,7 @@ part of vector_math;

/// 2D column vector.
class Vector2 implements Vector {
final Float32List storage;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break implementing Vector? It has a public storage property.

johnmccutchan added a commit that referenced this pull request Apr 8, 2015
@johnmccutchan johnmccutchan merged commit ff7a4f0 into google:master Apr 8, 2015
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

3 participants