Skip to content

Commit ed9c0ab

Browse files
author
vitamin
committed
ignore scope in some privat methods
1 parent 143579c commit ed9c0ab

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/basic_string/package.d

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ if(isSomeChar!_Char && is(Unqual!_Char == _Char)){
171171

172172

173173
//_long:
174-
private @property inout(Char)* _long_ptr()inout scope return pure nothrow @nogc @trusted{
174+
private @property inout(Char)* _long_ptr()inout scope pure nothrow @nogc @trusted{
175175
assert(this._long.isLong);
176176

177177
return this._long.ptr;
178178
}
179179

180-
private @property inout(void)[] _long_data()inout scope return pure nothrow @nogc @trusted{
180+
private @property inout(void)[] _long_data()inout scope pure nothrow @nogc @trusted{
181181
assert(this._long.isLong);
182182

183183
return (cast(void*)this._long.ptr)[0 .. this._long.capacity * Char.sizeof];
@@ -195,30 +195,32 @@ if(isSomeChar!_Char && is(Unqual!_Char == _Char)){
195195
return this._long.length;
196196
}
197197

198-
private @property inout(Char)[] _long_chars()inout scope return pure nothrow @nogc @trusted{
198+
private @property inout(Char)[] _long_chars()inout scope pure nothrow @nogc @trusted{
199199
assert(this._long.isLong);
200200

201201
return this._long.ptr[0 .. this._long.length];
202202
}
203203

204-
private @property inout(Char)[] _long_all_chars()inout scope return pure nothrow @nogc @trusted{
204+
private @property inout(Char)[] _long_all_chars()inout scope pure nothrow @nogc @trusted{
205205
assert(this._long.isLong);
206206

207207
return this._long.ptr[0 .. this._long.capacity];
208208
}
209209

210210

211211
//_short:
212-
private @property inout(Char)* _short_ptr()inout return pure nothrow @nogc @trusted{
212+
private @property inout(Char)* _short_ptr()inout scope pure nothrow @nogc @trusted{
213213
assert(this._short.isShort);
214214

215-
return this._short.data.ptr;
215+
auto ret = this._short.data.ptr;
216+
return *&ret;
216217
}
217218

218-
private @property inout(void)[] _short_data()inout return pure nothrow @nogc @trusted{
219+
private @property inout(void)[] _short_data()inout scope pure nothrow @nogc @trusted{
219220
assert(this._short.isShort);
220221

221-
return (cast(void*)this._short.data.ptr)[0 .. this._short.capacity * Char.sizeof];
222+
auto ret = (cast(void*)this._short.data.ptr)[0 .. this._short.capacity * Char.sizeof];
223+
return *&ret;
222224
}
223225

224226
private @property size_t _short_capacity()const scope pure nothrow @nogc @safe{
@@ -233,16 +235,18 @@ if(isSomeChar!_Char && is(Unqual!_Char == _Char)){
233235
return this._short.length;
234236
}
235237

236-
private @property inout(Char)[] _short_chars()inout return pure nothrow @nogc @safe{
238+
private @property inout(Char)[] _short_chars()inout scope pure nothrow @nogc @trusted{
237239
assert(this._short.isShort);
238240

239-
return this._short.data[0 .. this._short.length];
241+
auto ret = this._short.data[0 .. this._short.length];
242+
return *&ret;
240243
}
241244

242-
private @property inout(Char)[] _short_all_chars()inout return pure nothrow @nogc @trusted{
245+
private @property inout(Char)[] _short_all_chars()inout scope pure nothrow @nogc @trusted{
243246
assert(this._short.isShort);
244247

245-
return this._short.data[];
248+
auto ret = this._short.data[];
249+
return *&ret;
246250
}
247251

248252

@@ -261,13 +265,13 @@ if(isSomeChar!_Char && is(Unqual!_Char == _Char)){
261265
this._long.length = len;
262266
}
263267

264-
private @property inout(Char)[] _chars()inout return pure nothrow @trusted @nogc{
268+
private @property inout(Char)[] _chars()inout scope pure nothrow @trusted @nogc{
265269
return this._sso
266270
? this._short_chars()
267271
: this._long_chars();
268272
}
269273

270-
private @property inout(Char)[] _all_chars()inout return pure nothrow @trusted @nogc{
274+
private @property inout(Char)[] _all_chars()inout scope pure nothrow @trusted @nogc{
271275
return this._sso
272276
? this._short_all_chars()
273277
: this._long_all_chars();

0 commit comments

Comments
 (0)