Don't bother using slice when creating handlers

This commit is contained in:
Robert
2023-10-16 16:29:36 +01:00
parent d937934737
commit 46e7dda6a6

View File

@@ -128,9 +128,7 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
const removeModelClickedHandlers = useMemo(
() =>
modeledMethods
.slice(0, modeledMethods.length - 1)
.map((_, index) => () => {
modeledMethods.map((_, index) => () => {
const newModeledMethods = [...modeledMethods];
newModeledMethods.splice(index, 1);
onChange(method.signature, newModeledMethods);