Revert "use at() to get exceptions"

This reverts commit d91d5425d3f2b6ad9f1975c948e064faa4c251a4.
This commit is contained in:
2025-05-03 12:49:40 -05:00
parent a84ec50045
commit c718a9a186
2 changed files with 10 additions and 10 deletions

View File

@@ -40,10 +40,10 @@ public:
} }
public: public:
Type& operator[](size_t x) { Type& operator[](size_t x) {
return ref.data.at(ref.w * y + x); return ref.data[ref.w * y + x];
} }
const Type& operator[](size_t x) const { const Type& operator[](size_t x) const {
return ref.data.at(ref.w * y + x); return ref.data[ref.w * y + x];
} }
row_ref operator=(row_ref&& other) { row_ref operator=(row_ref&& other) {
row_ref& me = *this; row_ref& me = *this;
@@ -94,10 +94,10 @@ public:
} }
public: public:
Type& operator[](size_t y) { Type& operator[](size_t y) {
return ref.data.at(ref.w * y + x); return ref.data[ref.w * y + x];
} }
const Type& operator[](size_t y) const { const Type& operator[](size_t y) const {
return ref.data.at(ref.w * y + x); return ref.data[ref.w * y + x];
} }
col_ref operator=(col_ref&& other) { col_ref operator=(col_ref&& other) {
col_ref& me = *this; col_ref& me = *this;
@@ -139,7 +139,7 @@ public:
const_row_ref(const vector2d<Type, Alloc>& ref, size_t row) : ref(ref), y(row) {} const_row_ref(const vector2d<Type, Alloc>& ref, size_t row) : ref(ref), y(row) {}
public: public:
const Type& operator[](size_t x) const { const Type& operator[](size_t x) const {
return ref.data.at(ref.w * y + x); return ref.data[ref.w * y + x];
} }
}; };
class const_col_ref { class const_col_ref {
@@ -149,7 +149,7 @@ public:
const_col_ref(const vector2d<Type, Alloc>& ref, size_t col) : ref(ref), x(col) {} const_col_ref(const vector2d<Type, Alloc>& ref, size_t col) : ref(ref), x(col) {}
public: public:
const Type& operator[](size_t y) const { const Type& operator[](size_t y) const {
return ref.data.at(ref.w * y + x); return ref.data[ref.w * y + x];
} }
}; };
col_ref operator[](size_t x) { col_ref operator[](size_t x) {

View File

@@ -822,19 +822,19 @@ bool cCurTown::is_on_map(short x, short y) const {
} }
auto cCurOut::operator [] (size_t i) -> arr_96& { auto cCurOut::operator [] (size_t i) -> arr_96& {
return out.at(i); return out[i];
} }
auto cCurOut::operator [] (size_t i) const -> const arr_96& { auto cCurOut::operator [] (size_t i) const -> const arr_96& {
return out.at(i); return out[i];
} }
ter_num_t& cCurOut::operator [] (location loc) { ter_num_t& cCurOut::operator [] (location loc) {
return out.at(loc.x).at(loc.y); return out[loc.x][loc.y];
} }
const ter_num_t& cCurOut::operator [] (location loc) const { const ter_num_t& cCurOut::operator [] (location loc) const {
return out.at(loc.x).at(loc.y); return out[loc.x][loc.y];
} }
void cCurOut::writeTo(std::ostream& file) const { void cCurOut::writeTo(std::ostream& file) const {