Simplify logic in Soong ApiLevelFromUserWithConfig
Currently, ApiLevelFromUser calls ReplaceFinalizedCodename(raw). This function checks whether raw is in the getFinalCodenamesMap which is equivalent to ApiLevelsMapReleasedVersion with an additional entry for current. Since ApiLevelFromUserWithConfig already returned on the raw = "current" we only care about ApiLevelsMapReleasedVersion and can avoid the unecessary use of strconv.Atoi(strconv.Itoa(raw)) that calling ReplaceFinalizedCodename ends up doing. Also makes the function look more like the Bazel version in build/bazel/rules/common/api.bzl Change-Id: I8c03fc159d7f63298273624f030d1956e2307615 Test: m bp2build
Loading
Please register or sign in to comment