------------------------------------------------------------------------------ Description Does the array `attributes' of size `size' have `attribute'?
| 440 | // Description |
| 441 | // Does the array `attributes' of size `size' have `attribute'? |
| 442 | vtkTypeBool vtkGenericAttributeCollection::HasAttribute(int size, int* attributes, int attribute) |
| 443 | { |
| 444 | assert("pre: positive_size" && size >= 0); |
| 445 | assert("pre: valid_attributes" && |
| 446 | ((!(size > 0)) || (attributes != nullptr))); // size>0 => attributes!=0 (A=>B: !A||B ) |
| 447 | |
| 448 | int result = 0; // false |
| 449 | int i; |
| 450 | |
| 451 | if (size != 0) |
| 452 | { |
| 453 | i = 0; |
| 454 | while (!result && i++ < size) |
| 455 | { |
| 456 | result = attributes[i] == attribute; |
| 457 | } |
| 458 | } |
| 459 | return result; |
| 460 | } |
| 461 | |
| 462 | //------------------------------------------------------------------------------ |
| 463 | // Description: |
no test coverage detected