GITSNIPER

Turn messy PR feedback into actionable fixes in seconds.

Works with
GitHub
GitLab

From Web GUI to AI-Ready Format

One click. Perfectly structured for LLMs.

perf: Optimize URL encoding with lookup table #4821
Conversation8
Commits4
Checks
Files changed3
shadowdev reviewed 2 weeks ago View reviewed changes
contrib/epee/src/abstract_http_client.cpp
92 - else
93 - result += uri[i];
94 -
31 + std::string result (uri.size() * (hex_byte_len + 1), '\0'); // reserve max
SD
shadowdev 2 weeks ago ...
I think you're better off with a default-initialized string and then a reserve (avoids a pointless memset). 😊
Reply...
contrib/epee/src/abstract_http_client.cpp
45 45 for (size_t i = 0; i < uri.size(); ++i)
46 46 {
47 - *it++ = '%';
48 - *it++ = hex[(c >> 4) & 0xF];
49 - *it++ = hex[c & 0xF];
47 + memcpy(&result[out_idx], lookup[c], 3);
48 + out_idx += lookup_len[c];
SD
shadowdev 2 weeks ago ...
Consider using snprintf() for the two-digit uppercase hex formatting instead of manual nibble handling. Safer and more readable.
Reply...
GitSniper Extension
Copied to clipboard!
Terminal - Extracted Comments
EXTRACTED: PR #4821 COMMENTS

==================================================

FILE: contrib/epee/src/abstract_http_client.cpp
--------------------------------------------------

DIFF CONTEXT (lines 92-94, 31):
-        else
-          result += uri[i];
-
+      std::string result (uri.size() * (hex_byte_len + 1), '\0');

COMMENT (@shadowdev):
I think you're better off with a default-initialized
string and then a `reserve` (avoids a pointless memset).

---

FILE: contrib/epee/src/abstract_http_client.cpp
--------------------------------------------------

DIFF CONTEXT (lines 47-49):
-        *it++ = '%';
-        *it++ = hex[(c >> 4) & 0xF];
-        *it++ = hex[c & 0xF];
+        memcpy(&result[out_idx], lookup[c], 3);
+        out_idx += lookup_len[c];

COMMENT (@shadowdev):
Consider using `snprintf()` for the two-digit uppercase
hex formatting instead of manual nibble handling.
Safer and more readable.


==================================================
DEBUG INFORMATION:
==================================================
Total comments found: 2
Comments excluded: 0

Authors detected:
  - @shadowdev (Reviewer)

Paste into Claude, ChatGPT, or any LLM to implement feedback.

SMART EXTRACTION

Intelligently parses MR/PR comments with full diff context. Preserves code snippets, line references, and threading.

MULTI-PLATFORM

Works seamlessly with GitHub and GitLab. Self-hosted instances supported out of the box.

AUTHOR FILTERING

Exclude specific authors from extraction. Focus on the feedback that matters to you.

CUSTOM PREAMBLES

Add custom context to your extractions. Perfect for AI-assisted code review workflows.