Skip to content

Commit

Permalink
Updating comments of CamelCase Function (mlpack#3854)
Browse files Browse the repository at this point in the history
* Optimize CamelCase function

* removal of unnecessary changes
  • Loading branch information
shyama7004 authored Dec 13, 2024
1 parent b201756 commit 69b296b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mlpack/bindings/util/camel_case.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ inline std::string CamelCase(std::string s, bool lower)
size_t resInd = 0;
for (size_t i = 0; i < n; i++)
{
// Check for spaces in the sentence.
// Check for underscores in the string.
if (s[i] == '_')
{
// Conversion into upper case.
s[i + 1] = toupper(s[i + 1]);
continue;
}
// If not space, copy character.
// If not underscore, copy character.
else
s[resInd++] = s[i];
}
Expand Down

0 comments on commit 69b296b

Please sign in to comment.