You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by mygityf <gi...@git.apache.org> on 2016/01/28 12:09:18 UTC

[GitHub] thrift pull request: To check element of self whether nil or not,a...

GitHub user mygityf opened a pull request:

    https://github.com/apache/thrift/pull/824

    To check element of self whether nil or not,avoid the value(false) of…

    … BOOL is lost.
    
    eg.
    Before:
      if self.argBool then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    After:
      if self.argBool ~= nil then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    Why:
      the value(false) for paramater self.argBool will be lost when condition is 'if self.argBool then' as before.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gityf/thrift master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/824.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #824
    
----
commit 0d0cf5aa589389d40a2bd71a9e09e790634aff36
Author: unknown <wa...@xz-20141016zrqg.didichuxing.com>
Date:   2016-01-28T11:08:05Z

    To check element of self whether nil or not,avoid the value(false) of BOOL is lost.
    
    eg.
    Before:
      if self.argBool then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    After:
      if self.argBool ~= nil then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    Why:
      the value(false) for paramater self.argBool will be lost when condition is 'if self.argBool then' as before.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3584 To check element of self whether ...

Posted by mygityf <gi...@git.apache.org>.
Github user mygityf closed the pull request at:

    https://github.com/apache/thrift/pull/824


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: To check element of self whether nil or not,a...

Posted by nsuke <gi...@git.apache.org>.
Github user nsuke commented on the pull request:

    https://github.com/apache/thrift/pull/824#issuecomment-176192447
  
    @mygityf thanks for great contribution !
    Could you create two issues in our JIRA for these changes ?
    http://thrift.apache.org/docs/HowToContribute


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: To check element of self whether nil or not,a...

Posted by mygityf <gi...@git.apache.org>.
Github user mygityf commented on the pull request:

    https://github.com/apache/thrift/pull/824#issuecomment-176135894
  
    Thank you.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---