Skip to content

Commit

Permalink
Micro-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Oct 23, 2024
1 parent 5a71ded commit 6da8ec3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/map/IMG/jls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ bool JLS::decode(const SubFile *file, SubFile::Handle &hdl, Matrix<qint16> &img)
if (!readLine(bs))
return false;

memcpy(&img.at(i, 0), _current + 1, _w * sizeof(quint16));
memcpy(img.row(i), _current + 1, _w * sizeof(quint16));

quint16 *tmp = _last;
_last = _current;
Expand Down
1 change: 1 addition & 0 deletions src/map/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Matrix
T &at(int n) {return _m[n];}
T &at(int i, int j) {return _m[_w * i + j];}
T const &at(int i, int j) const {return _m.at(_w * i + j);}
T *row(int i) {return &_m[_w * i];}

bool isNull() const {return (_h == 0 || _w == 0);}
int size() const {return _m.size();}
Expand Down

0 comments on commit 6da8ec3

Please sign in to comment.