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

expression, plan: rewrite builtin function: IS TRUE && IS FALSE #4086

Merged
merged 18 commits into from
Aug 11, 2017

Conversation

zz-jason
Copy link
Member

@zz-jason zz-jason commented Aug 8, 2017

to #4080


isTrue, err := isTrueSig.eval(nil)
c.Assert(err, IsNil)
c.Assert(isTrue, testutil.DatumEquals, types.NewDatum(tc.isTrue))
Copy link
Contributor

Choose a reason for hiding this comment

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

s/ NewDatum/ NewIntDatum(int64(tc.isTrue))


isFalse, err := isFalseSig.eval(nil)
c.Assert(err, IsNil)
c.Assert(isFalse, testutil.DatumEquals, types.NewDatum(tc.isFalse))
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

}{
{
args: []interface{}{int64(-12)},
isTrue: int64(1),
Copy link
Contributor

Choose a reason for hiding this comment

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

remove int64()

Copy link
Member

@hanfei1991 hanfei1991 left a comment

Choose a reason for hiding this comment

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

LGTM

@hanfei1991 hanfei1991 added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 9, 2017
@zz-jason
Copy link
Member Author

@XuHuaiyu updated, PTAL

@zz-jason
Copy link
Member Author

@jackysp @breeswish @winkyao PTAL


var sig builtinFunc
switch {
case c.op == opcode.IsTruth && argTp == tpReal:
Copy link
Contributor

Choose a reason for hiding this comment

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

two switch may be more explict?
siwtch c.op{
switch argtP{
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

no need, it makes code complex

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu XuHuaiyu merged commit eb7eb43 into master Aug 11, 2017
@XuHuaiyu XuHuaiyu deleted the opfunc_istrue branch August 11, 2017 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants