We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0acd2b7 commit 80631f4Copy full SHA for 80631f4
1 file changed
src/brpc/redis_command.cpp
@@ -370,10 +370,19 @@ size_t RedisCommandParser::ParsedArgsSize() {
370
return _args.size();
371
}
372
373
+int find_crlf(const char* pfc, size_t length) {
374
+ for (size_t i = 0; i < length - 1; ++i) {
375
+ if (pfc[i] == '\r' && pfc[i + 1] == '\n') {
376
+ return i;
377
+ }
378
379
+ return -1;
380
+}
381
+
382
ParseError RedisCommandParser::Consume(butil::IOBuf& buf,
383
std::vector<butil::StringPiece>* args,
384
butil::Arena* arena) {
- const char* pfc = (const char*)buf.fetch1();
385
+ const auto pfc = static_cast<const char *>(buf.fetch1());
386
if (pfc == NULL) {
387
return PARSE_ERROR_NOT_ENOUGH_DATA;
388
0 commit comments