summaryrefslogtreecommitdiff
path: root/src/lq/Printer.java
diff options
context:
space:
mode:
authorJohn H. Anthony <johnhant@gmail.com>2010-09-04 07:18:07 +0200
committerJohn H. Anthony <johnhant@gmail.com>2010-09-04 07:21:03 +0200
commitb504b5fe05410bc259cd4349d1b51dc355eb0d90 (patch)
tree6bb722c781c4c244234a0b36fcb28f54c0ab417b /src/lq/Printer.java
parentdaa5375585d276e53aadcff670a4eba3ecf2279e (diff)
store sum and number of votes in each quote
This seems to improve the response time. We don't store a list of votes for each quote, which mean we don't have to retrieve every vote when we get the list of quotes. The only time we need to access the vote table is when we add a new vote.
Diffstat (limited to 'src/lq/Printer.java')
-rw-r--r--src/lq/Printer.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lq/Printer.java b/src/lq/Printer.java
index 7677450..e5bdc0b 100644
--- a/src/lq/Printer.java
+++ b/src/lq/Printer.java
@@ -21,7 +21,7 @@ public class Printer {
String date = DateUtil.dateFormat.format(quote.getQuoteDate());
out.println("Dato: " + date + ", Score: ");
out.println("<span id=\"v" + quote.getId() + "\">");
- out.println((score==null?"-":(score+ " (fra " + quote.getVotes().size() +")")));
+ out.println((score==null?"-":(score+ " (fra " + quote.getNumVotes() +")")));
out.println("<br> Vote: <font size=\"-1\">");
for(int nv=1; nv<=5; nv++)
out.println("<a href=\"javascript:ajaxvote(" + quote.getId() + ","+nv+")\">"+nv+"</a> ");