mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
parent
49ac2eb3ae
commit
d41571ea5a
@ -49,7 +49,10 @@ namespace dlib
|
||||
<< "\n\t i: " << i
|
||||
<< "\n\t size(): " << size()
|
||||
);
|
||||
return data[(i+offset)%data.size()];
|
||||
auto index = i + offset;
|
||||
if (index >= data.size())
|
||||
index -= data.size();
|
||||
return data[index];
|
||||
}
|
||||
|
||||
const T& operator[] ( unsigned long i) const
|
||||
@ -61,7 +64,10 @@ namespace dlib
|
||||
<< "\n\t i: " << i
|
||||
<< "\n\t size(): " << size()
|
||||
);
|
||||
return data[(i+offset)%data.size()];
|
||||
auto index = i + offset;
|
||||
if (index >= data.size())
|
||||
index -= data.size();
|
||||
return data[index];
|
||||
}
|
||||
|
||||
void resize(unsigned long size)
|
||||
|
Loading…
Reference in New Issue
Block a user