Permalink
Browse files

encodePrettily cause the code to be called twice

I used a logger and found the route is called twice. I opened a bug on vertx-web.
its about 5 ms slower (on my machine with the logger) 9 ms instead of 4 ms
there are other places this can be fixed in this code sample.
  • Loading branch information...
1 parent cf1da8a commit f0bef39d747c0b6bc916d8529a3dcabb25344f05 @gadieichhorn gadieichhorn committed on GitHub Dec 29, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 osgi-examples/src/main/java/io/vertx/example/osgi/VertxWebApplication.java
@@ -71,7 +71,7 @@ private void handleGetProduct(RoutingContext routingContext) {
if (product == null) {
sendError(404, response);
} else {
- response.putHeader("content-type", "application/json").end(product.encodePrettily());
+ response.putHeader("content-type", "application/json").end(product.encode());
}
}
}

0 comments on commit f0bef39

Please sign in to comment.