Skip to content

Builtin pow (from Add pow builtin ) #106

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

Merged
merged 3 commits into from
Oct 23, 2018
Merged

Builtin pow (from Add pow builtin ) #106

merged 3 commits into from
Oct 23, 2018

Conversation

alanjds
Copy link

@alanjds alanjds commented Oct 6, 2018

Rebased from google#373 over #92

@alanjds alanjds requested a review from a team October 8, 2018 16:04
func builtinPower(f *Frame, args Args, kwargs KWArgs) (*Object, *BaseException) {
argc := len(args)
expectedTypes := []*Type{ObjectType, ObjectType}
if argc == 3 {
Copy link

Choose a reason for hiding this comment

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

length will be cached and there is no overhead
for better performance we can remove argc initialization.

Copy link
Author

@alanjds alanjds Oct 8, 2018

Choose a reason for hiding this comment

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

you want to replace with if argc = len(args) { ?

Copy link

Choose a reason for hiding this comment

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

no.
just using len(args), instead of declaring and initializing argc.

func builtinPower(f *Frame, args Args, kwargs KWArgs) (*Object, *BaseException) { expectedTypes := []*Type{ObjectType, ObjectType} if argc == len(args) {

It's not a problem @alanjds , It's just for more performance.

Copy link
Author

Choose a reason for hiding this comment

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

Done on 0a11050.
Waiting to merge.

@r21gh r21gh merged commit 1083bdb into master Oct 23, 2018
@alanjds
Copy link
Author

alanjds commented Oct 23, 2018

Why are our builds failing ever with working code?

@alanjds alanjds deleted the builtin-pow branch October 29, 2018 02:07
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.

3 participants