File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,10 @@ struct SmallArray(T, uint maxLength)
181
181
ref typeof (this ) append (T elem)
182
182
{
183
183
if (_length == maxLength)
184
- throw exception;
184
+ {
185
+ version (D_Exceptions) throw exception;
186
+ else assert (0 , errorMsg);
187
+ }
185
188
_data[_length++ ] = elem;
186
189
return this ;
187
190
}
@@ -190,7 +193,10 @@ struct SmallArray(T, uint maxLength)
190
193
ref typeof (this ) append (V[] array)
191
194
{
192
195
if (_length + array.length > maxLength)
193
- throw exception;
196
+ {
197
+ version (D_Exceptions) throw exception;
198
+ else assert (0 , errorMsg);
199
+ }
194
200
_data[_length .. _length + array.length] = array;
195
201
_length += array.length;
196
202
return this ;
Original file line number Diff line number Diff line change @@ -194,7 +194,10 @@ extern(D):
194
194
{
195
195
auto length = asArray.length;
196
196
if (length == maxLength)
197
- throw exception;
197
+ {
198
+ version (D_Exceptions) throw exception;
199
+ else assert (0 , errorMsg);
200
+ }
198
201
_data[length] = c;
199
202
return this ;
200
203
}
@@ -204,7 +207,10 @@ extern(D):
204
207
{
205
208
auto length = asArray.length;
206
209
if (length + str.length > maxLength)
207
- throw exception;
210
+ {
211
+ version (D_Exceptions) throw exception;
212
+ else assert (0 , errorMsg);
213
+ }
208
214
if (__ctfe)
209
215
_data[length .. str.length + length] = str;
210
216
else
You can’t perform that action at this time.
0 commit comments