Skip to content

Instantly share code, notes, and snippets.

@IslamRustamov
Created June 7, 2023 20:00
Show Gist options
  • Save IslamRustamov/19840cce712d08c0cc8fe34767312779 to your computer and use it in GitHub Desktop.
Save IslamRustamov/19840cce712d08c0cc8fe34767312779 to your computer and use it in GitHub Desktop.
std::vector<int> NativeSampleModule::sort(jsi::Runtime& rt, std::vector<int> input) {
int i = 0;
int j = 0;
int temp = 0;
std::vector<int> foo = input;
for(i = 0; i < foo.size(); i++) {
for(j = 0; j < foo.size() - 1; j++) {
if(foo[j + 1] < foo[j]) {
temp = foo[j];
foo[j] = foo[j + 1];
foo[j + 1] = temp;
}
}
}
return foo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment