[Bug] Fix compile failed that cannot find symbol for variable scanRangeLength, Introduced by #4914 #4912