Skip to content

Commit ec56312

Browse files
authored
Merge pull request #1615 from joto/starts-with
Remove dependency on boost::algorithm
2 parents 4fb97e6 + b53e8d3 commit ec56312

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/actions/win-install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ runs:
44
using: composite
55
steps:
66
- name: Install packages
7-
run: vcpkg install bzip2:x64-windows expat:x64-windows zlib:x64-windows proj4:x64-windows boost-algorithm:x64-windows boost-system:x64-windows boost-filesystem:x64-windows boost-property-tree:x64-windows lua:x64-windows libpq:x64-windows
7+
run: vcpkg install bzip2:x64-windows expat:x64-windows zlib:x64-windows proj4:x64-windows boost-system:x64-windows boost-filesystem:x64-windows boost-property-tree:x64-windows lua:x64-windows libpq:x64-windows
88
shell: bash
99
- name: Install psycopg2
1010
run: python -m pip install psycopg2

src/tagtransform-c.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* For a full list of authors see the git log.
88
*/
99

10-
#include <boost/algorithm/string/predicate.hpp>
1110
#include <cstdlib>
1211
#include <cstring>
1312

@@ -99,6 +98,11 @@ std::unique_ptr<tagtransform_t> c_tagtransform_t::clone() const
9998
return std::make_unique<c_tagtransform_t>(m_options, m_export_list);
10099
}
101100

101+
static bool starts_with(char const *input, std::string const& test) noexcept
102+
{
103+
return std::strncmp(input, test.c_str(), test.size()) == 0;
104+
}
105+
102106
bool c_tagtransform_t::check_key(std::vector<taginfo> const &infos,
103107
char const *k, bool *filter,
104108
unsigned int *flags)
@@ -131,7 +135,7 @@ bool c_tagtransform_t::check_key(std::vector<taginfo> const &infos,
131135
if (!m_options->hstore_columns.empty()) {
132136
/* does this column match any of the hstore column prefixes? */
133137
for (auto const &column : m_options->hstore_columns) {
134-
if (boost::starts_with(k, column)) {
138+
if (starts_with(k, column)) {
135139
/* ... but if hstore_match_only is set then don't take this
136140
as a reason for keeping the object */
137141
if (!m_options->hstore_match_only) {

0 commit comments

Comments
 (0)