src/or/consdiff.c
static int
smartlist_slice_string_pos(smartlist_slice_t *slice, const char *string)
{
  int end = slice->offset + slice->len;
  for (int i = slice->offset; i < end; ++i) {
    const char *el = smartlist_get(slice->list, i);
    if (!strcmp(el, string)) {
      return i;
    }
  }
  return -1;
}
/** Like smartlist_string_pos, but limited to the bounds of the slice.
 */
Like smartlist_string_pos, but limited to the bounds of the slice.
Like smartlist_string_pos but limited to the bounds of the slice .
static int
smartlist_slice_string_pos(smartlist_slice_t *slice, const char *string)
{
  int end = slice->offset + slice->len;
  for (int i = slice->offset; i < end; ++i) {
    const char *el = smartlist_get(slice->list, i);
    if (!strcmp(el, string)) {
      return i;
    }
  }
  return -1;
}
static int smartlist_slice_string_pos ( smartlist_slice_t * slice , const char * string ) { int end = slice -> offset + slice -> len ; for ( int i = slice -> offset ; i < end ; ++ i ) { const char * el = smartlist_get ( slice -> list , i ) ; if ( ! strcmp ( el , string ) ) { return i ; } } return -1 ; }
Like smartlist_string_pos, but limited to the bounds of the slice.
Like smartlist_string_pos but limited to the bounds of the slice .