Skip to content

Commit 238c872

Browse files
committed
GENERIC_2D_ARRAY: Pass parameters by reference
This fixes warnings from LGTM: This parameter of type FontClassInfo is 192 bytes - consider passing a pointer/reference instead. Signed-off-by: Stefan Weil <[email protected]>
1 parent a798218 commit 238c872

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ccstruct/matrix.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class GENERIC_2D_ARRAY {
365365
}
366366

367367
// Accumulates the element-wise sums of squares of src into *this.
368-
void SumSquares(const GENERIC_2D_ARRAY<T>& src, T decay_factor) {
368+
void SumSquares(const GENERIC_2D_ARRAY<T>& src, const T& decay_factor) {
369369
T update_factor = 1.0 - decay_factor;
370370
int size = num_elements();
371371
for (int i = 0; i < size; ++i) {
@@ -377,7 +377,7 @@ class GENERIC_2D_ARRAY {
377377
// Scales each element using the adam algorithm, ie array_[i] by
378378
// sqrt(sqsum[i] + epsilon)).
379379
void AdamUpdate(const GENERIC_2D_ARRAY<T>& sum,
380-
const GENERIC_2D_ARRAY<T>& sqsum, T epsilon) {
380+
const GENERIC_2D_ARRAY<T>& sqsum, const T& epsilon) {
381381
int size = num_elements();
382382
for (int i = 0; i < size; ++i) {
383383
array_[i] += sum.array_[i] / (sqrt(sqsum.array_[i]) + epsilon);

0 commit comments

Comments
 (0)