[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 71b3b04 1/2: Don't copy vector passed to ledg
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 71b3b04 1/2: Don't copy vector passed to ledger_format() |
Date: |
Thu, 29 Jun 2017 18:25:16 -0400 (EDT) |
branch: master
commit 71b3b04da41c2489805671872da63372cfde84a5
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Don't copy vector passed to ledger_format()
This is a micro-optimization or, rather, correction of a
micro-pessimization as there is really no need at all for copying the
vectors passed to this function.
---
ledger_text_formats.cpp | 2 +-
ledger_text_formats.hpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ledger_text_formats.cpp b/ledger_text_formats.cpp
index 1dc333f..98db9a0 100644
--- a/ledger_text_formats.cpp
+++ b/ledger_text_formats.cpp
@@ -1203,7 +1203,7 @@ std::string ledger_format
}
std::vector<std::string> ledger_format
- (std::vector<double> dv
+ (std::vector<double> const& dv
,std::pair<int,oenum_format_style> f
)
{
diff --git a/ledger_text_formats.hpp b/ledger_text_formats.hpp
index 4da0629..696a352 100644
--- a/ledger_text_formats.hpp
+++ b/ledger_text_formats.hpp
@@ -50,7 +50,7 @@ std::string LMI_SO ledger_format
);
std::vector<std::string> LMI_SO ledger_format
- (std::vector<double> dv
+ (std::vector<double> const& dv
,std::pair<int,oenum_format_style> f
);