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 <sw@weilnetz.de>
  • Loading branch information
stweil committed Dec 1, 2016
1 parent bb6cfc1 commit f3e8895
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
Expand Up @@ -147,7 +147,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) {
EmptyConstructor();
int flags = TF_COMPRESS_UNICHARSET;
training_flags_ = static_cast<TrainingFlags>(flags);
Expand Down
2 changes: 1 addition & 1 deletion lstm/lstmtrainer.h
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 f3e8895

Please sign in to comment.