Skip to content
Commit fb502512 authored by Alix's avatar Alix
Browse files

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
parent b7261066
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment