Skip to content

Commit

Permalink
remove dead c++ code
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed May 6, 2024
1 parent 613c754 commit 429787c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
4 changes: 0 additions & 4 deletions R/cpp11.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ marquee_c <- function(text, styles, ignore_html) {
place_bullets <- function(type, indent, string_is_empty, bullet_number, bullets) {
.Call(`_marquee_place_bullets`, type, indent, string_is_empty, bullet_number, bullets)
}

block_is_last <- function(indentation, id) {
.Call(`_marquee_block_is_last`, indentation, id)
}
8 changes: 0 additions & 8 deletions src/cpp11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,9 @@ extern "C" SEXP _marquee_place_bullets(SEXP type, SEXP indent, SEXP string_is_em
return cpp11::as_sexp(place_bullets(cpp11::as_cpp<cpp11::decay_t<cpp11::strings>>(type), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(indent), cpp11::as_cpp<cpp11::decay_t<cpp11::logicals>>(string_is_empty), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(bullet_number), cpp11::as_cpp<cpp11::decay_t<cpp11::list_of<cpp11::strings>>>(bullets)));
END_CPP11
}
// marquee.cpp
cpp11::writable::logicals block_is_last(cpp11::integers indentation, cpp11::integers id);
extern "C" SEXP _marquee_block_is_last(SEXP indentation, SEXP id) {
BEGIN_CPP11
return cpp11::as_sexp(block_is_last(cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(indentation), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(id)));
END_CPP11
}

extern "C" {
static const R_CallMethodDef CallEntries[] = {
{"_marquee_block_is_last", (DL_FUNC) &_marquee_block_is_last, 2},
{"_marquee_marquee_c", (DL_FUNC) &_marquee_marquee_c, 3},
{"_marquee_place_bullets", (DL_FUNC) &_marquee_place_bullets, 5},
{NULL, NULL, 0}
Expand Down
16 changes: 0 additions & 16 deletions src/marquee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,19 +535,3 @@ cpp11::writable::list place_bullets(cpp11::strings type, cpp11::integers indent,
"placement"_nm = placement
});
}

[[cpp11::register]]
cpp11::writable::logicals block_is_last(cpp11::integers indentation, cpp11::integers id) {
cpp11::writable::logicals res;

for (R_xlen_t i = 0; i < indentation.size() - 1; ++i) {
int ind = indentation[i];
int this_id = id[i];
R_xlen_t next_block = i + 1;
while (next_block < indentation.size() && this_id == id[next_block] && ind < indentation[next_block]) next_block++;
res.push_back(next_block == indentation.size() || this_id != id[next_block] || ind != indentation[next_block]);
}
res.push_back(true);

return res;
}

0 comments on commit 429787c

Please sign in to comment.