ignore regex (#4264)

Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/4264

same as title

Reviewed By: bshethmeta

Differential Revision: D72179831

fbshipit-source-id: 9e77ef382312e843e68f388ee6360a6b26b032d4
pull/4270/head
Junjie Qi 2025-03-31 23:00:18 -07:00 committed by Facebook GitHub Bot
parent ccc2b33c88
commit 7f523f0849
1 changed files with 4 additions and 3 deletions

View File

@ -66,7 +66,8 @@ namespace {
*/ */
bool re_match(const std::string& s, const std::string& pat, std::smatch& sm) { bool re_match(const std::string& s, const std::string& pat, std::smatch& sm) {
return std::regex_match(s, sm, std::regex(pat)); // NO-LINT : regex_match // @lint-ignore CLANGTIDY
return std::regex_match(s, sm, std::regex(pat));
} }
// find first pair of matching parentheses // find first pair of matching parentheses
@ -176,8 +177,8 @@ AdditiveQuantizer::Search_type_t aq_parse_search_type(
std::vector<size_t> aq_parse_nbits(std::string stok) { std::vector<size_t> aq_parse_nbits(std::string stok) {
std::vector<size_t> nbits; std::vector<size_t> nbits;
std::smatch sm; std::smatch sm;
while (std::regex_search( // @lint-ignore CLANGTIDY
stok, sm, std::regex("[^q]([0-9]+)x([0-9]+)"))) { // NO-LINT while (std::regex_search(stok, sm, std::regex("[^q]([0-9]+)x([0-9]+)"))) {
int M = std::stoi(sm[1].str()); int M = std::stoi(sm[1].str());
int nbit = std::stoi(sm[2].str()); int nbit = std::stoi(sm[2].str());
nbits.resize(nbits.size() + M, nbit); nbits.resize(nbits.size() + M, nbit);