mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-14 03:03:13 +08:00
Merge pull request #1049 from Juneezee/master
Avoid unnecessary byte/string conversion
This commit is contained in:
@@ -511,7 +511,7 @@ func uninstall(version string) {
|
||||
func versionNumberFrom(version string) string {
|
||||
reg, _ := regexp.Compile("[^0-9]")
|
||||
|
||||
if reg.Match([]byte(version[:1])) {
|
||||
if reg.MatchString(version[:1]) {
|
||||
if version[0:1] != "v" {
|
||||
url := web.GetFullNodeUrl("latest-" + version + "/SHASUMS256.txt")
|
||||
content := strings.Split(web.GetRemoteTextFile(url), "\n")[0]
|
||||
@@ -529,7 +529,7 @@ func versionNumberFrom(version string) string {
|
||||
}
|
||||
}
|
||||
|
||||
for reg.Match([]byte(version[:1])) {
|
||||
for reg.MatchString(version[:1]) {
|
||||
version = version[1:]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user