From ff4f961ba5f5fc455da54d7cd00cb06bab62bfc8 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Mon, 28 Dec 2009 18:07:28 +0200 Subject: [PATCH] core: Clean-up & indent recently added code --- src/rygel/rygel-http-item-uri.vala | 49 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/src/rygel/rygel-http-item-uri.vala b/src/rygel/rygel-http-item-uri.vala index 245e22f..268001c 100644 --- a/src/rygel/rygel-http-item-uri.vala +++ b/src/rygel/rygel-http-item-uri.vala @@ -39,29 +39,34 @@ internal class Rygel.HTTPItemURI : Object { this.transcode_target = null; var request_uri = uri.replace (server_root, ""); var parts = request_uri.split ("/"); - if (parts.length < 2 || parts.length % 2 == 0) + + if (parts.length < 2 || parts.length % 2 == 0) { warning ("Invalid uri %s", request_uri); - else { - for (int i = 1; i < parts.length - 1; i += 2) { - switch (parts[i]) { - case "item": - StringBuilder sb = new StringBuilder (); - size_t len; - var data = Base64.decode ( - Soup.URI.decode (parts[i + 1]), - out len); - sb.append_len ((string) data, (ssize_t) len); - this.item_id = sb.str; - break; - case "transcoded": - this.transcode_target = Soup.URI.decode (parts[i + 1]); - break; - case "thumbnail": - this.thumbnail_index = parts[i + 1].to_int (); - break; - default: - break; - } + + return; + } + + for (int i = 1; i < parts.length - 1; i += 2) { + switch (parts[i]) { + case "item": + size_t len; + var data = Base64.decode (Soup.URI.decode (parts[i + 1]), + out len); + StringBuilder builder = new StringBuilder (); + builder.append_len ((string) data, (ssize_t) len); + this.item_id = builder.str; + + break; + case "transcoded": + this.transcode_target = Soup.URI.decode (parts[i + 1]); + + break; + case "thumbnail": + this.thumbnail_index = parts[i + 1].to_int (); + + break; + default: + break; } } } -- 2.7.4