Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

improve even odd checking and avoid substr call where unnecessary#13952

Closed
marijaselakovic wants to merge 2 commits intoangular:masterfrom
marijaselakovic:master
Closed

improve even odd checking and avoid substr call where unnecessary#13952
marijaselakovic wants to merge 2 commits intoangular:masterfrom
marijaselakovic:master

Conversation

@marijaselakovic
Copy link
Copy Markdown
Contributor

I would propose two slight optimizations:

  1. You should avoid call to substr if not necessary, so instead vendorPrefix.substr(0, 1), use vendorPrefix[0] which is cheaper and semantically equivalent.

  2. As explained in https://github.com/angular/angular.js/pull/4359, adapt even odd checking in ngClass

@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

1 similar comment
@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@marijaselakovic
Copy link
Copy Markdown
Contributor Author

I signed it!

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Feb 5, 2016
@gkalpak
Copy link
Copy Markdown
Member

gkalpak commented Feb 5, 2016

There is a jsHint check failure (see https://travis-ci.org/angular/angular.js/jobs/107253414).
You need to disable jsHint's bitwise check for that line.

disabled jsHint's bitwise check
@Narretz
Copy link
Copy Markdown
Contributor

Narretz commented May 24, 2016

Landed as 4ae4cc9 and 4fed5d8

@Narretz Narretz closed this May 24, 2016
gkalpak referenced this pull request Aug 19, 2016
This now uses the same technique as ngRepeat.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants