Revert "fix: optimization: Various PVS-Studio warnings"
This commit is contained in:
@@ -28,8 +28,8 @@ struct ThreadPoolResult {
|
||||
template<class T, class R>
|
||||
class Worker {
|
||||
public:
|
||||
Worker() = default;
|
||||
virtual ~Worker() = default;
|
||||
Worker() {}
|
||||
virtual ~Worker() {}
|
||||
virtual R operator()(const std::shared_ptr<T>&) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
class ArgsReader {
|
||||
const char* last = "";
|
||||
char** argv;
|
||||
int argc;
|
||||
char** argv;
|
||||
int pos = 0;
|
||||
const char* last = "";
|
||||
public:
|
||||
ArgsReader(int argc, char** argv) : argv(argv), argc(argc) {}
|
||||
ArgsReader(int argc, char** argv) : argc(argc), argv(argv) {}
|
||||
|
||||
void skip() {
|
||||
pos++;
|
||||
|
||||
@@ -7,7 +7,7 @@ std::string util::to_string(const std::vector<std::string>& vec) {
|
||||
std::stringstream ss;
|
||||
ss << "[";
|
||||
for (size_t i = 0; i < vec.size(); i++) {
|
||||
ss << util::quote(vec[1]);
|
||||
ss << util::quote(vec.at(i));
|
||||
if (i < vec.size()-1) {
|
||||
ss << ", ";
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ std::string util::quote(const std::string& s) {
|
||||
return escape(s);
|
||||
}
|
||||
|
||||
std::wstring util::lfill(const std::wstring& s, uint length, wchar_t c) {
|
||||
std::wstring util::lfill(std::wstring s, uint length, wchar_t c) {
|
||||
if (s.length() >= length) {
|
||||
return s;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ std::wstring util::lfill(const std::wstring& s, uint length, wchar_t c) {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
std::wstring util::rfill(const std::wstring& s, uint length, wchar_t c) {
|
||||
std::wstring util::rfill(std::wstring s, uint length, wchar_t c) {
|
||||
if (s.length() >= length) {
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace util {
|
||||
/// @brief Function used for error messages
|
||||
std::string quote(const std::string& s);
|
||||
|
||||
std::wstring lfill(const std::wstring& s, uint length, wchar_t c);
|
||||
std::wstring rfill(const std::wstring& s, uint length, wchar_t c);
|
||||
std::wstring lfill(std::wstring s, uint length, wchar_t c);
|
||||
std::wstring rfill(std::wstring s, uint length, wchar_t c);
|
||||
|
||||
uint encode_utf8(uint32_t c, ubyte* bytes);
|
||||
uint32_t decode_utf8(uint& size, const char* bytes);
|
||||
|
||||
Reference in New Issue
Block a user