Skip to content

Commit 8318348

Browse files
committed
unify code style
1 parent 1d52636 commit 8318348

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

inst/include/infoxtr/distance.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ namespace distance
166166
inline double distance(
167167
const std::vector<double>& vec,
168168
const double scalar,
169-
std::string method = "euclidean",
169+
const std::string& method = "euclidean",
170170
bool na_rm = true)
171171
{
172172
if (vec.empty() || std::isnan(scalar))
@@ -225,7 +225,7 @@ namespace distance
225225
inline double distance(
226226
const double scalar,
227227
const std::vector<double>& vec,
228-
std::string method = "euclidean",
228+
const std::string& method = "euclidean",
229229
bool na_rm = true)
230230
{
231231
return distance(vec, scalar, method, na_rm);
@@ -263,7 +263,7 @@ namespace distance
263263
inline double distance(
264264
const std::vector<double>& vec1,
265265
const std::vector<double>& vec2,
266-
std::string method = "euclidean",
266+
const std::string& method = "euclidean",
267267
bool na_rm = true)
268268
{
269269
if (vec1.empty() || vec2.empty() || vec1.size() != vec2.size())
@@ -383,7 +383,7 @@ namespace distance
383383
***************************************************************************/
384384
inline std::vector<std::vector<double>> distance(
385385
const std::vector<std::vector<double>>& mat,
386-
std::string method = "euclidean",
386+
const std::string& method = "euclidean",
387387
bool na_rm = true,
388388
bool byrow = true)
389389
{

0 commit comments

Comments
 (0)