FLEX-26808 Simplified getFirstItemValue using the ternary operator.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/c316cba2 Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/c316cba2 Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/c316cba2 Branch: refs/heads/develop Commit: c316cba2a63b671080a6b3be0f69aa8813482fe6 Parents: 5d677c2 Author: Mihai Chira <mih...@apache.org> Authored: Tue Mar 22 12:30:55 2016 +0100 Committer: Mihai Chira <mih...@apache.org> Committed: Tue Mar 22 12:30:55 2016 +0100 ---------------------------------------------------------------------- frameworks/projects/framework/src/mx/utils/VectorUtil.as | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/c316cba2/frameworks/projects/framework/src/mx/utils/VectorUtil.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/utils/VectorUtil.as b/frameworks/projects/framework/src/mx/utils/VectorUtil.as index 79a0056..51a3da3 100644 --- a/frameworks/projects/framework/src/mx/utils/VectorUtil.as +++ b/frameworks/projects/framework/src/mx/utils/VectorUtil.as @@ -24,10 +24,7 @@ package mx.utils { */ public static function getFirstItemValue(v:Vector.<int>):int { - if (v && v.length > 0) - return v[0]; - else - return -1; + return v && v.length ? v[0] : -1; } } }