Skip to content

Commit

Permalink
fix: use constant reference to prevent variable copy
Browse files Browse the repository at this point in the history
  • Loading branch information
hiikariri committed Jun 19, 2024
1 parent 8ff56fe commit 671b3dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kansei_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char * argv[])
{
auto args = rclcpp::init_and_remove_ros_arguments(argc, argv);

std::string port_name = "/dev/serial/by-id/usb-Seeed_Seeed_XIAO_M0_E8D70AB55154305147202020FF050926-if00";
std::string port_name = "/dev/ttyUSB1";
std::string path = "";
kansei::fallen::DeterminantType determinant_type;

Expand All @@ -48,7 +48,7 @@ int main(int argc, char * argv[])

if (args.size() > 1) {
for (int i = 1; i < args.size(); i++) {
std::string arg = args[i];
const std::string& arg = args[i];
if (arg == "-h" || arg == "--help") {
std::cout << help_message << std::endl;
return 1;
Expand All @@ -62,7 +62,7 @@ int main(int argc, char * argv[])
}
} else if (arg == "--type") {
if (i + 1 < args.size()) {
std::string fallen_type = args[i + 1];
const std::string& fallen_type = args[i + 1];
if (fallen_type == "orientation") {
determinant_type = kansei::fallen::DeterminantType::ORIENTATION;
} else if (fallen_type == "accelero") {
Expand Down

0 comments on commit 671b3dd

Please sign in to comment.