Skip to content

Commit

Permalink
lstm: Pass big parameter by reference (performance)
Browse files Browse the repository at this point in the history
Coverity report:

CID 1366448 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter recoder of type
 tesseract::UnicharCompress const (size 240 bytes) by value.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Nov 28, 2016
1 parent 037a7ff commit 9dab030
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lstm/lstmtrainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void LSTMTrainer::InitCharSet(const UNICHARSET& unicharset,
// ctc_mode controls how the truth text is mapped to the network targets.
// Note: Call before InitNetwork!
void LSTMTrainer::InitCharSet(const UNICHARSET& unicharset,
const UnicharCompress recoder) {
const UnicharCompress& recoder) {
// Call before InitNetwork.
ASSERT_HOST(network_ == NULL);
EmptyConstructor();
Expand Down
2 changes: 1 addition & 1 deletion lstm/lstmtrainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class LSTMTrainer : public LSTMRecognizer {
// previously setup UNICHARSET and UnicharCompress.
// ctc_mode controls how the truth text is mapped to the network targets.
// Note: Call before InitNetwork!
void InitCharSet(const UNICHARSET& unicharset, const UnicharCompress recoder);
void InitCharSet(const UNICHARSET& unicharset, const UnicharCompress& recoder);

// Initializes the trainer with a network_spec in the network description
// net_flags control network behavior according to the NetworkFlags enum.
Expand Down

0 comments on commit 9dab030

Please sign in to comment.