metricsql icon indicating copy to clipboard operation
metricsql copied to clipboard

i is not equal to j

Open thinkersong opened this issue 2 years ago • 0 comments

https://github.com/VictoriaMetrics/metricsql/blob/a271ee257023dd183d444ec7e1b363c64a3db0e3/lexer.go#L641

	if s[i] == '.' {
		j := i
		i++
		for i < len(s) && isDecimalChar(s[i]) {
			i++
		}
		if i == j || i == len(s) {
			return -1
		}
	}

I'm learning MetricsQL and I've noticed that here 'i' might not be equal to 'j' because 'i' undergoes an addition operation. Should it be j+1 here?

thinkersong avatar Dec 11 '23 14:12 thinkersong