Skip to content

Commit

Permalink
Remove implicit integer conversion in SparseByteSet
Browse files Browse the repository at this point in the history
Summary:
Found when tried to use `SparseByteSet`. Compiler wasn't happy,
because `-Wimplicit-int-conversion` flag was set.

```
error: implicit conversion loses integer precision: 'int' to 'uint8_t' (aka 'unsigned char') [-Werror,-Wimplicit-int-conversion]
        dense_[sparse_[i]] = last_element;
```

Reviewed By: marksantaniello, DenisYaroshevskiy

Differential Revision: D60284815

fbshipit-source-id: 5a70acd40f16bb5d31c3f361de1954a55af4d05d
  • Loading branch information
ilvokhin authored and facebook-github-bot committed Jul 29, 2024
1 parent 7c4f66a commit a11e16e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion folly/container/SparseByteSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SparseByteSet {
bool r = contains(i);
if (r) {
if (dense_[size_ - 1] != i) {
int last_element = dense_[size_ - 1];
uint8_t last_element = dense_[size_ - 1];
dense_[sparse_[i]] = last_element;
sparse_[last_element] = sparse_[i];
}
Expand Down

0 comments on commit a11e16e

Please sign in to comment.