Skip to content

Commit

Permalink
fix: array not found
Browse files Browse the repository at this point in the history
  • Loading branch information
cheetahbyte committed Aug 5, 2024
1 parent 653877a commit b04e333
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
cmake-build-*/
.idea/
build/
releases.yaml
7 changes: 4 additions & 3 deletions src/commit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
#include "commit.h"
#include <sstream>
#include <utility>
#include <array>

std::string trim(const std::string &str) {
size_t first = str.find_first_not_of(" \t\n\r\f\v");
const size_t first = str.find_first_not_of(" \t\n\r\f\v");
if (first == std::string::npos)
return "";
size_t last = str.find_last_not_of(" \t\n\r\f\v");
const size_t last = str.find_last_not_of(" \t\n\r\f\v");
return str.substr(first, last - first + 1);
}

std::array<std::string, 4> splitCommit(std::string& commit) {
std::array<std::string, 4> splitCommit(const std::string& commit) {
std::istringstream stream(commit);
std::string line;
std::array<std::string, 4> parts; // Array to store commit hash, author, date, and message
Expand Down

0 comments on commit b04e333

Please sign in to comment.