libfly / Moxture

MIT License
25 stars 3 forks source link

Replace structure to class to avoid copying on mutate #2

Closed imnosov closed 3 years ago

imnosov commented 3 years ago

Description

This PR is to fix an issue related to copying FuncMock.

Root cause

In some cases especially when passing to closures, we faced issues related to copying on mutate. Sometimes not all calls are written to FuncMock.

Solution

Change all structure declaration to classes

Impact

Apple recommends to use struct whenever it's possible for performance and safety reasons. Thus it may insignificantly impact the performance.