mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-07 10:02:24 +02:00
change bounds checking to check if index is strictly less than 0
This commit is contained in:
parent
a6c569dd78
commit
2051a9953c
1 changed files with 3 additions and 3 deletions
|
@ -43,7 +43,7 @@ void Instance::enumerateNics() {
|
|||
json Instance::getCPU(int index) {
|
||||
assert(index <(int) _cpus.size());
|
||||
|
||||
if (index <= 0 || (int) _cpus.size() <= index)
|
||||
if (index < 0 || (int) _cpus.size() <= index)
|
||||
return json();
|
||||
|
||||
return _cpus.at(index);
|
||||
|
@ -52,7 +52,7 @@ json Instance::getCPU(int index) {
|
|||
json Instance::getGPU(int index) {
|
||||
assert(index <(int) _gpus.size());
|
||||
|
||||
if (index <= 0 || (int) _gpus.size() <= index)
|
||||
if (index < 0 || (int) _gpus.size() <= index)
|
||||
return json();
|
||||
|
||||
return _gpus.at(index);
|
||||
|
@ -61,7 +61,7 @@ json Instance::getGPU(int index) {
|
|||
json Instance::getDisplay(int index) {
|
||||
assert(index <(int) _displays.size());
|
||||
|
||||
if (index <= 0 || (int) _displays.size() <= index)
|
||||
if (index < 0 || (int) _displays.size() <= index)
|
||||
return json();
|
||||
|
||||
return _displays.at(index);
|
||||
|
|
Loading…
Reference in a new issue