diff options
author | alberth <alberth@openttd.org> | 2015-08-08 13:19:38 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2015-08-08 13:19:38 +0000 |
commit | 1105b4d2c99e99750f42b7a39443bb03b40f4afa (patch) | |
tree | a936197f608b155036ffd2c553065cc8cbabc014 /src/misc/array.hpp | |
parent | b885d79f506bde93b4ab278b3f84b8ca6254f3b9 (diff) | |
download | openttd-1105b4d2c99e99750f42b7a39443bb03b40f4afa.tar.xz |
(svn r27363) -Codechange: Fix codestyle of one-line methods and header codestyle of derived structs.
Diffstat (limited to 'src/misc/array.hpp')
-rw-r--r-- | src/misc/array.hpp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/misc/array.hpp b/src/misc/array.hpp index 9796f18ea..c49f2afc4 100644 --- a/src/misc/array.hpp +++ b/src/misc/array.hpp @@ -42,9 +42,16 @@ protected: public: /** implicit constructor */ - inline SmallArray() { } + inline SmallArray() + { + } + /** Clear (destroy) all items */ - inline void Clear() {data.Clear();} + inline void Clear() + { + data.Clear(); + } + /** Return actual number of items */ inline uint Length() const { @@ -54,13 +61,29 @@ public: return (super_size - 1) * B + sub_size; } /** return true if array is empty */ - inline bool IsEmpty() { return data.IsEmpty(); } + inline bool IsEmpty() + { + return data.IsEmpty(); + } + /** return true if array is full */ - inline bool IsFull() { return data.IsFull() && data[N - 1].IsFull(); } + inline bool IsFull() + { + return data.IsFull() && data[N - 1].IsFull(); + } + /** allocate but not construct new item */ - inline T *Append() { return FirstFreeSubArray().Append(); } + inline T *Append() + { + return FirstFreeSubArray().Append(); + } + /** allocate and construct new item */ - inline T *AppendC() { return FirstFreeSubArray().AppendC(); } + inline T *AppendC() + { + return FirstFreeSubArray().AppendC(); + } + /** indexed access (non-const) */ inline T& operator[](uint index) { |