Skip to content

Commit

Permalink
add explicit cast for msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
bkietz authored Jun 25, 2019
1 parent 9cee25e commit a4bfaac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp/src/arrow/compute/kernels/take-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,16 +412,17 @@ class TestPermutationsWithTake : public ComputeFixture, public TestBase {
}

std::shared_ptr<Int16Array> Inverse(const std::shared_ptr<Int16Array>& permutation) {
std::vector<bool> cycle_lengths(permutation->length() + 1, false);
auto length = static_cast<int16_t>(permutation->length());

std::vector<bool> cycle_lengths(length + 1, false);
auto permutation_to_the_i = permutation;
for (int16_t cycle_length = 1; cycle_length <= permutation->length();
++cycle_length) {
for (int16_t cycle_length = 1; cycle_length <= length; ++cycle_length) {
cycle_lengths[cycle_length] = HasTrivialCycle(*permutation_to_the_i);
permutation_to_the_i = Take(*permutation, *permutation_to_the_i);
}

uint64_t cycle_to_identity_length = 1;
for (int16_t cycle_length = permutation->length(); cycle_length > 1; --cycle_length) {
for (int16_t cycle_length = length; cycle_length > 1; --cycle_length) {
if (!cycle_lengths[cycle_length]) {
continue;
}
Expand Down

0 comments on commit a4bfaac

Please sign in to comment.