mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
15 lines
236 B
Go
15 lines
236 B
Go
package main
|
|
|
|
func isPrefixOfGood2(xs, ys []int) bool {
|
|
if len(ys) == 0 { // OK: not inside the loop
|
|
return len(xs) == 0
|
|
}
|
|
|
|
for i := 0; i < len(xs); i++ {
|
|
if len(ys) <= i || xs[i] != ys[i] {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|