You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR changes a few places where we used to have we had something
like:
```cxx
constexpr const char* kConstant[] = ...
```
These arrays array are not as safe as proper containers. There's also
the challange that the strings referred by these arrays cannot have
their sizes encoded on the type, so there's a certain reliance on
`strlen` to determine the size.
This change converts on of these arrays to `std::array`. The other array
was converted to a `constexpr` flat set, as that is what this array was
being used for. This flat set requires a custom comparator though, as
the search of the elements as matching against `end_with`. With this
change, the lookup will be a bit less wasteful.
Resolvesbrave/brave-browser#42484
This PR changes a few places where we used to have we had something
like:
```cxx
constexpr const char* kConstant[] = ...
```
These arrays array are not as safe as proper containers. There's also
the challange that the strings referred by these arrays cannot have
their sizes encoded on the type, so there's a certain reliance on
`strlen` to determine the size.
This change converts on of these arrays to `std::array`. The other array
was converted to a `constexpr` flat set, as that is what this array was
being used for. This flat set requires a custom comparator though, as
the search of the elements as matching against `end_with`. With this
change, the lookup will be a bit less wasteful.
Resolvesbrave/brave-browser#42484
This PR changes a few places where we used to have we had something
like:
```cxx
constexpr const char* kConstant[] = ...
```
These arrays array are not as safe as proper containers. There's also
the challange that the strings referred by these arrays cannot have
their sizes encoded on the type, so there's a certain reliance on
`strlen` to determine the size.
This change converts on of these arrays to `std::array`. The other array
was converted to a `constexpr` flat set, as that is what this array was
being used for. This flat set requires a custom comparator though, as
the search of the elements as matching against `end_with`. With this
change, the lookup will be a bit less wasteful.
Resolvesbrave/brave-browser#42484
Description
These are the few remaining cases of array of strings that can be modernised.
The text was updated successfully, but these errors were encountered: