Skip to content

Commit

Permalink
test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Nov 6, 2024
1 parent 0fa8b68 commit f8f3940
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ ssize_t READ(const int fd, uint8_t *whereto, size_t len)
{
ssize_t cnt = len;

while(len > 0)
{
while(len > 0) {
ssize_t rc = read(fd, whereto, len);
if (rc <= 0)
return rc;
Expand Down Expand Up @@ -68,8 +67,7 @@ std::vector<std::string> split(std::string in, const std::string & splitter)
std::vector<std::string> out;
size_t splitter_size = splitter.size();

for(;;)
{
for(;;) {
size_t pos = in.find(splitter);
if (pos == std::string::npos)
break;
Expand All @@ -78,8 +76,7 @@ std::vector<std::string> split(std::string in, const std::string & splitter)
out.push_back(before);

size_t bytes_left = in.size() - (pos + splitter_size);
if (bytes_left == 0)
{
if (bytes_left == 0) {
out.push_back("");
return out;
}
Expand Down

0 comments on commit f8f3940

Please sign in to comment.