cginternals / cginternals/openll
FontLoader: bitwise OR always returns true: bug or feature?
Open
bug
question
- Dominant language
- C++
- Stars
- 7
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Have a look at FontLoader.cpp, lines 262 - 272 (code below).
If `valid `begins as `true` and further operations are just bitwise OR, then `valid `is always `true`.
Do you want to return an empty `StringPair` if not all mandatory keys are provided, as the comment suggests? If so, this code is a bug.
```
// check if all required keys are provided
auto valid = true;
for (const auto mandatoryKey : mandatoryKeys)
{
valid |= pairs.find(mandatoryKey) != pairs.cend();
}
if (!valid)
return StringPairs();
return pairs;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.