int endIndex(int startIndex) { var si = startIndex + snapCount; return si < itemCount ? si : itemCount; }