This commit is contained in:
Henrik Rydgård committed 2026-09-02 18:15:17 +02:00
1 parent 597e2bc6c0
commit ef6029cc2e
2 files changed
+28 -1

No files matched your search

+27
View File
@@ -605,6 +605,33 @@ Keep commit messages focused, not overly long (although sometimes it's motivated
is super complex). Do not report things like 100/100 tests passed - that's a given, if tests break
you aren't supposed to make a commit.
## Code style
4-wide tabs, not spaces.
Instead of:
`printf("%.*s", (int)part.size(), part.data());`
we have a macro:
`printf("%.*s", STR_VIEW(part));`
Style example:
```cpp
class MyClass {
public:
MyClass(int memberVar) : memberVar_(memberVar) {}
int MemberFunc();
private:
int memberVar_;
}
```
But generally follow the surrounding style. Braces are preferred on the same line. Braces are always used even when they could be omitted due the inner part being just a single line.
## Quick rebuild on Linux
You don't need to do ./b.sh --debug to verify every single little change, instead use this shortcut:
+1 -1
View File
@@ -36,7 +36,7 @@ bool RequestHeader::GetParamValue(const char *param_name, std::string *value) co
// for that, so parts[1] would be reading off the end of the vector.
continue;
}
DEBUG_LOG(Log::HTTP, "Param: %.*s Value: %.*s", (int)parts[0].size(), parts[0].data(), (int)parts[1].size(), parts[1].data());
DEBUG_LOG(Log::HTTP, "Param: %.*s Value: %.*s", STR_VIEW(parts[0]), STR_VIEW(parts[1]));
if (parts[0] == param_name) {
*value = parts[1];
return true;