Commit 76f1e6f
committed
Only check for
If there's not a getter method or getter property, then `attributeValue` will be null. If there is a getter method or getter property, then `attributeValue` might be null or empty. If it's null, that's ambiguous between whether the method existed in not. But if it's empty, we know the member existed and returned a value. In that case, we should trust that value instead of executing fallback logic with `String.IsNullOrEmpty()`.
A further optimization would be to confirm that it exists and only fallback if it doesn't. As these are comparatively rare scenarios, though, it doesn't make sense to add additional overhead for this check, and especially when it's already handled by the `GetMethodValue()` and `GetPropertyValue()` methods.null within GetScalarValue()
1 parent 9f1f677 commit 76f1e6f
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
| 623 | + | |
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
| 630 | + | |
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| |||
0 commit comments