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

'Value' methods (for scalars) do unnecessary checks for nil #10

Closed
seanm opened this issue Jan 15, 2010 · 3 comments
Closed

'Value' methods (for scalars) do unnecessary checks for nil #10

seanm opened this issue Jan 15, 2010 · 3 comments

Comments

@seanm
Copy link
Contributor

seanm commented Jan 15, 2010

When messaging nil, the return values are:

Ints up to 64 bits: 0
Pointers: nil
Structs: undefined
Float, double, long double: 0.0 on i386; 0.0 on ppc 10.5 and later; undefined on ppc 10.4 and earlier

mogenerator 1.16 creates code like this:

  • (int)volumeTypeValue {
    NSNumber *result = [self volumeType];
    return result ? [result intValue] : 0;
    }

The check for nil is not needed if the min deployment target is 10.5. Since mogenerator is now also unconditionally using @dynamic, 10.5 is now required, right? If so, we can remove these nil checks.

@rentzsch
Copy link
Owner

rentzsch commented Jul 1, 2010

Good point. Toss me a pull request?

@seanm
Copy link
Contributor Author

seanm commented Jul 21, 2010

@rentzsch
Copy link
Owner

Thanks! Closing.

This issue was closed.
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

No branches or pull requests

2 participants