Revision 4893c9e0 som/ChunkBuffer/buffer.c

View differences:

som/ChunkBuffer/buffer.c
50 50
{
51 51
  int i, min, pos_min;
52 52

  
53
  if (cb->buffer[0].id == id) {
54
    return -2;
55
  }
53 56
  min = cb->buffer[0].id; pos_min = 0;
54 57
  for (i = 1; i < cb->num_chunks; i++) {
58
    if (cb->buffer[i].id == id) {
59
      return -2;
60
    }
55 61
    if (cb->buffer[i].id < min) {
56 62
      min = cb->buffer[i].id;
57 63
      pos_min = i;
......
117 123
  }
118 124
  
119 125
  while(1) {
126
    if (cb->buffer[i].id == c->id) {
127
      return -2;
128
    }
120 129
    if (cb->buffer[i].id < 0) {
121 130
      cb->buffer[i] = *c;
122 131
      cb->num_chunks++;

Also available in: Unified diff