Skip to content

Commit c426503

Browse files
committed
Replace literal_at_local() with normal literal_at()
1 parent 1a2d3b4 commit c426503

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

src/markdown.cpp

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3434,29 +3434,16 @@ QCString Markdown::Private::processBlocks(std::string_view data,const size_t ind
34343434
return out;
34353435
}
34363436

3437-
#define OPC(x) #x " ",#x "\n"
3438-
static const StringVector otherPagingCmds =
3437+
static bool isOtherPage(std::string_view data)
34393438
{
3440-
OPC(dir), OPC(defgroup), OPC(addtogroup), OPC(weakgroup), OPC(ingroup),
3441-
OPC(fn), OPC(property), OPC(typedef), OPC(var), OPC(def),
3442-
OPC(enum), OPC(namespace), OPC(class), OPC(concept), OPC(module),
3443-
OPC(protocol), OPC(category), OPC(union), OPC(struct), OPC(interface),
3444-
OPC(idlexcept)
3445-
};
3439+
#define OPC(x) if (literal_at(data,#x " ") || literal_at(data,#x "\n")) return true
3440+
OPC(dir); OPC(defgroup); OPC(addtogroup); OPC(weakgroup); OPC(ingroup);
3441+
OPC(fn); OPC(property); OPC(typedef); OPC(var); OPC(def);
3442+
OPC(enum); OPC(namespace); OPC(class); OPC(concept); OPC(module);
3443+
OPC(protocol); OPC(category); OPC(union); OPC(struct); OPC(interface);
3444+
OPC(idlexcept);
34463445
#undef OPC
34473446

3448-
static bool literal_at_local(std::string_view data,const char *str)
3449-
{
3450-
size_t len = strlen(str);
3451-
return len<=data.size() && data[0]==str[0] && qstrncmp(data.data()+1,str+1,len-1)==0;
3452-
}
3453-
3454-
static bool isOtherPage(std::string_view data)
3455-
{
3456-
for (const auto &str : otherPagingCmds)
3457-
{
3458-
if (literal_at_local(data,str.c_str())) return true;
3459-
}
34603447
return false;
34613448
}
34623449

0 commit comments

Comments
 (0)