Skip to content

Commit 671b3dd

Browse files
committed
fix: use constant reference to prevent variable copy
1 parent 8ff56fe commit 671b3dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/kansei_main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(int argc, char * argv[])
3535
{
3636
auto args = rclcpp::init_and_remove_ros_arguments(argc, argv);
3737

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

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

4949
if (args.size() > 1) {
5050
for (int i = 1; i < args.size(); i++) {
51-
std::string arg = args[i];
51+
const std::string& arg = args[i];
5252
if (arg == "-h" || arg == "--help") {
5353
std::cout << help_message << std::endl;
5454
return 1;
@@ -62,7 +62,7 @@ int main(int argc, char * argv[])
6262
}
6363
} else if (arg == "--type") {
6464
if (i + 1 < args.size()) {
65-
std::string fallen_type = args[i + 1];
65+
const std::string& fallen_type = args[i + 1];
6666
if (fallen_type == "orientation") {
6767
determinant_type = kansei::fallen::DeterminantType::ORIENTATION;
6868
} else if (fallen_type == "accelero") {

0 commit comments

Comments
 (0)