This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch tristan/partial-variables-manual-string-join in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 20db0e114099a7e76576d0efdbbe0e0d823a9840 Author: Tristan van Berkom <[email protected]> AuthorDate: Thu Jul 9 18:20:42 2020 +0900 _variables.pyx: Early return from _resolve() --- src/buildstream/_variables.pyx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/buildstream/_variables.pyx b/src/buildstream/_variables.pyx index d455940..64c3ece 100644 --- a/src/buildstream/_variables.pyx +++ b/src/buildstream/_variables.pyx @@ -306,10 +306,17 @@ cdef class Variables: # references encountered when resolving the variable. # cdef str _resolve(self, str name, ScalarNode pnode): + + cdef Value iter_value + + # Try early return first + iter_value = self._get_checked_value(name, None, pnode) + if iter_value._resolved: + return iter_value._resolved + cdef ResolutionStep step cdef ResolutionStep new_step cdef ResolutionStep this_step - cdef Value iter_value cdef str resolved_value cdef Py_ssize_t idx = 0
