Skip to content

Commit 85f79e1

Browse files
committed
Mesh.cpp - swap inplace
1 parent 6d19d9c commit 85f79e1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎UnityPyBoost/Mesh.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ PyObject *unpack_vertexdata(PyObject *self, PyObject *args)
8585
uint16_t *componentUints = (uint16_t *)componentBytes;
8686
for (uint32_t i = 0; i < componentBytesLength; i += 2)
8787
{
88-
*componentUints++ = bswap16(*componentUints);
88+
swap_any_inplace(componentUints++);
8989
}
9090
}
9191
else if (componentByteSize == 4)
@@ -94,12 +94,12 @@ PyObject *unpack_vertexdata(PyObject *self, PyObject *args)
9494
uint32_t *componentUints = (uint32_t *)componentBytes;
9595
for (uint32_t i = 0; i < componentBytesLength; i += 4)
9696
{
97-
*componentUints++ = bswap32(*componentUints);
97+
swap_any_inplace(componentUints++);
9898
}
9999
}
100100
}
101101

102-
PyObject *res = PyByteArray_FromStringAndSize((const char*)componentBytes, componentBytesLength);
102+
PyObject *res = PyByteArray_FromStringAndSize((const char *)componentBytes, componentBytesLength);
103103
PyMem_Free(componentBytes);
104104
PyBuffer_Release(&vertexDataView);
105105
return res;

0 commit comments

Comments
 (0)