Commit af08e81
committed
Refactor WriteAddressValue to simplify type handling
The code changes in the `WriteAddressValue` method within the `MemHackLib.PlatformImplementations` namespace in `MemHackLin.cs` remove the conversion of the `value` parameter to a byte array. Instead, the updated implementation directly assigns the `value` to the `data` variable based on its type. Specifically, it checks if `value` is of type `int`, `long`, `short`, or `byte` and assigns `data` as a new `nint` with the corresponding value. If `value` is of an unsupported type, it returns an error message "Unsupported value type." This refactor simplifies the process and eliminates the need for byte array conversion and pinning.1 parent 77a09ea commit af08e81
1 file changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
402 | | - | |
403 | 401 | | |
404 | 402 | | |
405 | 403 | | |
| |||
408 | 406 | | |
409 | 407 | | |
410 | 408 | | |
411 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
412 | 422 | | |
413 | 423 | | |
414 | 424 | | |
| |||
0 commit comments