From 0440e1bc5be9df2e9add64ef44daa54e132aaa94 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Wed, 19 Feb 2020 12:47:57 +0100 Subject: [PATCH] Mark additional moor_ffi functions as deterministic --- moor_ffi/lib/src/impl/moor_functions.dart | 25 +++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/moor_ffi/lib/src/impl/moor_functions.dart b/moor_ffi/lib/src/impl/moor_functions.dart index 1dd830f7..9c7b5150 100644 --- a/moor_ffi/lib/src/impl/moor_functions.dart +++ b/moor_ffi/lib/src/impl/moor_functions.dart @@ -70,15 +70,22 @@ void _atanImpl(Pointer ctx, int argCount, void _registerOn(Database db) { final powImplPointer = Pointer.fromFunction(_powImpl); - db.createFunction('power', 2, powImplPointer); - db.createFunction('pow', 2, powImplPointer); + db.createFunction('power', 2, powImplPointer, isDeterministic: true); + db.createFunction('pow', 2, powImplPointer, isDeterministic: true); - db.createFunction('sqrt', 1, Pointer.fromFunction(_sqrtImpl)); + db.createFunction('sqrt', 1, Pointer.fromFunction(_sqrtImpl), + isDeterministic: true); - db.createFunction('sin', 1, Pointer.fromFunction(_sinImpl)); - db.createFunction('cos', 1, Pointer.fromFunction(_cosImpl)); - db.createFunction('tan', 1, Pointer.fromFunction(_tanImpl)); - db.createFunction('asin', 1, Pointer.fromFunction(_asinImpl)); - db.createFunction('acos', 1, Pointer.fromFunction(_acosImpl)); - db.createFunction('atan', 1, Pointer.fromFunction(_atanImpl)); + db.createFunction('sin', 1, Pointer.fromFunction(_sinImpl), + isDeterministic: true); + db.createFunction('cos', 1, Pointer.fromFunction(_cosImpl), + isDeterministic: true); + db.createFunction('tan', 1, Pointer.fromFunction(_tanImpl), + isDeterministic: true); + db.createFunction('asin', 1, Pointer.fromFunction(_asinImpl), + isDeterministic: true); + db.createFunction('acos', 1, Pointer.fromFunction(_acosImpl), + isDeterministic: true); + db.createFunction('atan', 1, Pointer.fromFunction(_atanImpl), + isDeterministic: true); }