소스 검색
pyenv-latest: fast path for when there is an exact match (#3437)
Avoids O(N^2) complexity when `pyenv-latest` is called in a loop
for existing entries
pull/3438/head
native-api
2 달 전
committed by
GitHub
No known key found for this signature in database
GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일과
5개의 추가작업 그리고
0개의 파일을 삭제
-
libexec/pyenv-latest
|
|
|
@ -10,6 +10,7 @@ |
|
|
|
set -e |
|
|
|
[ -n "$PYENV_DEBUG" ] && set -x |
|
|
|
|
|
|
|
|
|
|
|
while [[ $# -gt 0 ]] |
|
|
|
do |
|
|
|
case "$1" in |
|
|
|
@ -38,6 +39,10 @@ exitcode=0 |
|
|
|
IFS=$'\n' |
|
|
|
|
|
|
|
if [[ -z $FROM_KNOWN ]]; then |
|
|
|
if [[ -d $PYENV_ROOT/versions/$prefix ]]; then |
|
|
|
echo "$prefix" |
|
|
|
exit $exitcode; |
|
|
|
fi |
|
|
|
DEFINITION_CANDIDATES=( $(pyenv-versions --bare --skip-envs) ) |
|
|
|
else |
|
|
|
DEFINITION_CANDIDATES=( $(python-build --definitions ) ) |
|
|
|
|