Skip to content

Commit

Permalink
use std::string instead of String
Browse files Browse the repository at this point in the history
  • Loading branch information
elbersb committed Sep 19, 2023
1 parent cc52d5e commit eeed3ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ BEGIN_RCPP
END_RCPP
}
// get_crosswalk_cpp
List get_crosswalk_cpp(StringVector old_unit, StringVector new_unit);
List get_crosswalk_cpp(std::vector<std::string> old_unit, std::vector<std::string> new_unit);
RcppExport SEXP _segregation_get_crosswalk_cpp(SEXP old_unitSEXP, SEXP new_unitSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< StringVector >::type old_unit(old_unitSEXP);
Rcpp::traits::input_parameter< StringVector >::type new_unit(new_unitSEXP);
Rcpp::traits::input_parameter< std::vector<std::string> >::type old_unit(old_unitSEXP);
Rcpp::traits::input_parameter< std::vector<std::string> >::type new_unit(new_unitSEXP);
rcpp_result_gen = Rcpp::wrap(get_crosswalk_cpp(old_unit, new_unit));
return rcpp_result_gen;
END_RCPP
Expand Down
8 changes: 4 additions & 4 deletions src/compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ List compress_compute_cpp(
_["new_unit"] = results.new_unit);
}

int find_in_sets(String needle, std::vector<std::set<String>> haystack)
int find_in_sets(std::string needle, std::vector<std::set<std::string>> haystack)
{
for (int i = 0; i < haystack.size(); i++)
{
Expand All @@ -321,9 +321,9 @@ int find_in_sets(String needle, std::vector<std::set<String>> haystack)
}

// [[Rcpp::export]]
List get_crosswalk_cpp(StringVector old_unit, StringVector new_unit)
List get_crosswalk_cpp(std::vector<std::string> old_unit, std::vector<std::string> new_unit)
{
std::vector<std::set<String>> bags;
std::vector<std::set<std::string>> bags;

for (int i = 0; i < old_unit.size(); i++)
{
Expand Down Expand Up @@ -357,7 +357,7 @@ List get_crosswalk_cpp(StringVector old_unit, StringVector new_unit)
List l(bags.size());
for (int i = 0; i < bags.size(); i++)
{
StringVector bag(bags[i].size());
std::vector<std::string> bag(bags[i].size());
int index = 0;
for (auto el : bags[i])
{
Expand Down

0 comments on commit eeed3ad

Please sign in to comment.