aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/2d_array/2d_array.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/containers/2d_array/2d_array.h
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/2d_array/2d_array.h')
-rw-r--r--library/cpp/containers/2d_array/2d_array.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/containers/2d_array/2d_array.h b/library/cpp/containers/2d_array/2d_array.h
index d57f6e4b2f..9e24650637 100644
--- a/library/cpp/containers/2d_array/2d_array.h
+++ b/library/cpp/containers/2d_array/2d_array.h
@@ -1,5 +1,5 @@
#pragma once
-
+
#include <util/system/yassert.h>
#include <util/generic/algorithm.h>
@@ -27,9 +27,9 @@ private:
T** PData;
size_t XSize;
size_t YSize;
-
+
private:
- void Copy(const TArray2D& a) {
+ void Copy(const TArray2D& a) {
XSize = a.XSize;
YSize = a.YSize;
Create();
@@ -46,17 +46,17 @@ private:
for (size_t i = 0; i < YSize; i++)
PData[i] = Data + i * XSize;
}
-
+
public:
TArray2D(size_t xsize = 1, size_t ysize = 1) {
XSize = xsize;
YSize = ysize;
Create();
}
- TArray2D(const TArray2D& a) {
+ TArray2D(const TArray2D& a) {
Copy(a);
}
- TArray2D& operator=(const TArray2D& a) {
+ TArray2D& operator=(const TArray2D& a) {
Destroy();
Copy(a);
return *this;
@@ -73,7 +73,7 @@ public:
Create();
}
void Clear() {
- SetSizes(1, 1);
+ SetSizes(1, 1);
}
#ifdef _DEBUG
TBoundCheck<T> operator[](size_t i) const {
@@ -107,8 +107,8 @@ public:
}
};
-template <class T>
-inline bool operator==(const TArray2D<T>& a, const TArray2D<T>& b) {
+template <class T>
+inline bool operator==(const TArray2D<T>& a, const TArray2D<T>& b) {
if (a.GetXSize() != b.GetXSize() || a.GetYSize() != b.GetYSize())
return false;
for (size_t y = 0; y < a.GetYSize(); ++y) {
@@ -119,7 +119,7 @@ inline bool operator==(const TArray2D<T>& a, const TArray2D<T>& b) {
return true;
}
-template <class T>
-inline bool operator!=(const TArray2D<T>& a, const TArray2D<T>& b) {
+template <class T>
+inline bool operator!=(const TArray2D<T>& a, const TArray2D<T>& b) {
return !(a == b);
}