Created
June 7, 2023 20:00
-
-
Save IslamRustamov/19840cce712d08c0cc8fe34767312779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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