Skip to content

Commit 0ea757e

Browse files
authored
Remove unused header file (#6913)
1 parent 42cbca0 commit 0ea757e

File tree

3 files changed

+1
-113
lines changed

3 files changed

+1
-113
lines changed

include/util/matrix_graph_wrapper.hpp

Lines changed: 0 additions & 49 deletions
This file was deleted.

include/util/string_util.hpp

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,6 @@
1010
namespace osrm::util
1111
{
1212

13-
// precision: position after decimal point
14-
// length: maximum number of digits including comma and decimals
15-
// work with negative values to prevent overflowing when taking -value
16-
template <int length, int precision> char *printInt(char *buffer, int value)
17-
{
18-
static_assert(length > 0, "length must be positive");
19-
static_assert(precision > 0, "precision must be positive");
20-
21-
const bool minus = [&value]
22-
{
23-
if (value >= 0)
24-
{
25-
value = -value;
26-
return false;
27-
}
28-
return true;
29-
}();
30-
31-
buffer += length - 1;
32-
for (int i = 0; i < precision; ++i)
33-
{
34-
*buffer = '0' - (value % 10);
35-
value /= 10;
36-
--buffer;
37-
}
38-
*buffer = '.';
39-
--buffer;
40-
41-
for (int i = precision + 1; i < length; ++i)
42-
{
43-
*buffer = '0' - (value % 10);
44-
value /= 10;
45-
if (value == 0)
46-
{
47-
break;
48-
}
49-
--buffer;
50-
}
51-
52-
if (minus)
53-
{
54-
--buffer;
55-
*buffer = '-';
56-
}
57-
return buffer;
58-
}
59-
6013
inline bool RequiresJSONStringEscaping(const std::string &string)
6114
{
6215
for (const char letter : string)

unit_tests/util/string_util.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <boost/test/unit_test.hpp>
44

5-
#include <iostream>
5+
#include <string>
66

77
BOOST_AUTO_TEST_SUITE(string_util)
88

@@ -27,20 +27,4 @@ BOOST_AUTO_TEST_CASE(json_escaping)
2727
BOOST_CHECK(!RequiresJSONStringEscaping("Aleja Solidarnosci"));
2828
}
2929

30-
BOOST_AUTO_TEST_CASE(print_int)
31-
{
32-
const std::string input{"\b\\"};
33-
char buffer[12];
34-
buffer[11] = 0; // zero termination
35-
std::string output = printInt<11, 8>(buffer, 314158976);
36-
BOOST_CHECK_EQUAL(output, "3.14158976");
37-
38-
buffer[11] = 0;
39-
output = printInt<11, 8>(buffer, 0);
40-
BOOST_CHECK_EQUAL(output, "0.00000000");
41-
42-
output = printInt<11, 8>(buffer, -314158976);
43-
BOOST_CHECK_EQUAL(output, "-3.14158976");
44-
}
45-
4630
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)