summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-02-04 08:50:13 +0000
committerDavid Schleef <ds@schleef.org>2009-02-26 11:41:25 -0800
commit95f40f35f732135bb68e51459827298f7feda283 (patch)
tree8bda5a14b70775296f6b31f763cc1e0164c1fcf3
parent44e37448acce5344c6c53334e2a7e993707d9fff (diff)
downloadliboil-95f40f35f732135bb68e51459827298f7feda283.tar.gz
init: shortcut benchmarking, if there is only one runable implementation.
-rw-r--r--liboil/liboilfunction.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/liboil/liboilfunction.c b/liboil/liboilfunction.c
index fa1870c..f2eb440 100644
--- a/liboil/liboilfunction.c
+++ b/liboil/liboilfunction.c
@@ -367,6 +367,17 @@ oil_class_optimize (OilFunctionClass * klass)
OIL_ERROR ("class %s has no implmentations", klass->name);
return;
}
+
+ if (klass->first_impl->next == NULL) {
+ if (!oil_impl_is_runnable (klass->first_impl)) {
+ OIL_ERROR ("class %s has no runable implmentations", klass->name);
+ return;
+ }
+ OIL_DEBUG ("class %s has only one implementation %s", klass->name, klass->first_impl->name);
+ klass->chosen_impl = klass->first_impl;
+ klass->func = klass->first_impl->func;
+ return;
+ }
test = oil_test_new (klass);
if (test == NULL) {