src/common/urlloopbuffer.cc
UrlRecord* UrlLoopBuffer::GetRecord(int index) {
  // Normalize the index.
  index += data_->begin;
  if (index >= kUrlBufferSize) {
    index -= kUrlBufferSize;
  }

  // Validate the index.
  if (index < 0 || index >= kUrlBufferSize) {
    return NULL;
  }

  return &(data_->records[index]);
}
// both begin and end shouldn't be changed in this method.
// And only begin can be read in this method.
both begin and end shouldn't be changed in this method.
And only begin can be read in this method.
both begin and end shouldn ' t be changed in this method . And only begin can be read in this method .
UrlRecord* UrlLoopBuffer::GetRecord(int index) {
  index += data_->begin;
  if (index >= kUrlBufferSize) {
    index -= kUrlBufferSize;
  }
  if (index < 0 || index >= kUrlBufferSize) {
    return NULL;
  }
  return &(data_->records[index]);
}
UrlRecord * UrlLoopBuffer :: GetRecord ( int index ) { index += data_ -> begin ; if ( index >= kUrlBufferSize ) { index -= kUrlBufferSize ; } if ( index < 0 || index >= kUrlBufferSize ) { return NULL ; } return & ( data_ -> records [ index ] ) ; }
both begin and end shouldn't be changed in this method.
both begin and end shouldn ' t be changed in this method .
// Normalize the index. // Validate the index.