MCPcopy Create free account
hub / github.com/celer-pkg/celer / compareVersion

Method compareVersion

configs/toolchain_windows.go:332–343  ·  view source on GitHub ↗
(first, second string)

Source from the content-addressed store, hash-verified

330}
331
332func (t Toolchain) compareVersion(first, second string) int {
333 firstVersion := strings.Split(first, ".")
334 secondVersion := strings.Split(second, ".")
335 for i := 0; i < len(firstVersion) && i < len(secondVersion); i++ {
336 firstInt, _ := strconv.Atoi(firstVersion[i])
337 secondInt, _ := strconv.Atoi(secondVersion[i])
338 if firstInt != secondInt {
339 return firstInt - secondInt
340 }
341 }
342 return len(firstVersion) - len(secondVersion)
343}
344
345func (w *WindowsKit) Detect(msvc *context.MSVC) error {
346 // Check if installed.

Callers 1

findLatestMSVCVersionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected