Skip to content

Commit

Permalink
remove unused ragestring function that produces coverity defect
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 14, 2020
1 parent 8e95462 commit 43ae78d
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions src/RageUtil/Misc/RageString.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Etterna/Globals/global.h"
#include "Etterna/Globals/global.h"
#include "RageString.h"
#include "RageUnicode.h"
#include <algorithm>
Expand Down Expand Up @@ -46,30 +46,6 @@ Rage::ends_with(std::string const& source, std::string const& target)
return Rage::tail(source, target.size()) == target;
}

std::string
Rage::hexify(wchar_t const src, unsigned int dstlen)
{
static char const alphabet[] = "0123456789abcdef";

std::stringstream builder;

unsigned int i = 0;
wchar_t const* ptr = &src;

while (*ptr && (2 * i) + 1 < dstlen) {
builder << alphabet[*ptr / 16];
builder << alphabet[*ptr % 16];
++ptr;
++i;
}

std::string setup{ builder.str() };
while (setup.size() < dstlen) {
setup = '0' + setup;
}
return setup;
}

void
Rage::replace(std::string& target, char from, char to)
{
Expand Down Expand Up @@ -532,4 +508,4 @@ Rage::make_lower(std::string const& source)
::make_lower(&buffer[0], source.size());

return std::string{ buffer.begin(), buffer.end() - 1 };
}
}

0 comments on commit 43ae78d

Please sign in to comment.