[vlma-devel] commit: Avoid to switch adapters every time orders are given. ( Adrien Grand )

git version control git at videolan.org
Fri Feb 6 03:56:50 CET 2009


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Fri Feb  6 03:53:57 2009 +0100| [152bec0038837a3638b8af93551b533090b48cac] | committer: Adrien Grand 

Avoid to switch adapters every time orders are given.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=152bec0038837a3638b8af93551b533090b48cac
---

 .../main/java/org/videolan/vlma/model/Adapter.java |    6 +++---
 .../vlma/order/management/OrderManager.java        |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/vlma-api/src/main/java/org/videolan/vlma/model/Adapter.java b/vlma-api/src/main/java/org/videolan/vlma/model/Adapter.java
index a34185f..e26f4e2 100644
--- a/vlma-api/src/main/java/org/videolan/vlma/model/Adapter.java
+++ b/vlma-api/src/main/java/org/videolan/vlma/model/Adapter.java
@@ -187,14 +187,14 @@ public abstract class Adapter implements Serializable {
     /**
      * Increments the adapter's score.
      */
-    public void incrementScore() {
-        ++this.score;
+    public void increaseScore() {
+        this.score += 10;
     }
 
     /**
      * Decrements the adapter's score.
      */
-    public void decrementScore() {
+    public void decreaseScore() {
         --this.score;
     }
 
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/management/OrderManager.java b/vlma-core/src/main/java/org/videolan/vlma/order/management/OrderManager.java
index d12e43c..66cd752 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/management/OrderManager.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/management/OrderManager.java
@@ -88,9 +88,9 @@ public class OrderManager {
             entry.getValue().setValue(broadcasted ? State.STARTED : State.TO_START);
             // Update the adapter's score
             if (broadcasted) {
-                entry.getValue().getKey().getAdapter().incrementScore();
+                entry.getValue().getKey().getAdapter().increaseScore();
             } else {
-                entry.getValue().getKey().getAdapter().decrementScore();
+                entry.getValue().getKey().getAdapter().decreaseScore();
             }
         }
         return result;



More information about the vlma-devel mailing list