src/net/log/test_net_log_util.cc
size_t GetIndex(const std::vector<NetLogEntry>& entries, int offset) {
  if (offset >= 0)
    return static_cast<size_t>(offset);

  size_t abs_offset = static_cast<size_t>(-offset);
  // If offset indicates a position before the start of the array, just return
  // the end of the list.
  if (abs_offset > entries.size())
    return entries.size();
  return entries.size() - abs_offset;
}
// Takes the list of entries and an offset, and returns an index into the array.
// If |offset| is positive, just returns |offset|.  If it's negative, it
// indicates a position relative to the end of the array.
Takes the list of entries and an offset, and returns an index into the array.
If |offset| is positive, just returns |offset|.  If it's negative, it
indicates a position relative to the end of the array.
Takes the list of entries and an offset and returns an index into the array . If |offset| is positive just returns |offset| . If it ' s negative it indicates a position relative to the end of the array .
size_t GetIndex(const std::vector<NetLogEntry>& entries, int offset) {
  if (offset >= 0)
    return static_cast<size_t>(offset);
  size_t abs_offset = static_cast<size_t>(-offset);
  if (abs_offset > entries.size())
    return entries.size();
  return entries.size() - abs_offset;
}
size_t GetIndex ( const std :: vector < NetLogEntry > & entries , int offset ) { if ( offset >= 0 ) return static_cast < size_t > ( offset ) ; size_t abs_offset = static_cast < size_t > ( - offset ) ; if ( abs_offset > entries . size ( ) ) return entries . size ( ) ; return entries . size ( ) - abs_offset ; }
Takes the list of entries and an offset, and returns an index into the array.
Takes the list of entries and an offset and returns an index into the array .
// If offset indicates a position before the start of the array, just return // the end of the list.