Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit f0d795f

Browse files
committed
use swap function instead of adhoc implementation
1 parent d0ff3bd commit f0d795f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ldc/eh/win32.d

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,10 @@ nothrow:
306306

307307
void swap(ref ExceptionStack other)
308308
{
309-
auto olength = other._length; other._length = _length; _length = olength;
310-
auto op = other._p; other._p = _p; _p = op;
311-
auto ocap = other._cap; other._cap = _cap; _cap = ocap;
309+
static void swapField(T)(ref T a, ref T b) { T o = b; b = a; a = o; }
310+
swapField(_length, other._length);
311+
swapField(_p, other._p);
312+
swapField(_cap, other._cap);
312313
}
313314

314315
private:

0 commit comments

Comments
 (0)