From 73beeb52aac464d586b20a6c1d25cfe20f96f5f3 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Fri, 20 Aug 2010 12:20:25 +0300 Subject: [PATCH] core: Make some code more readable Make the code deciding whether or not the mode of the HTTP GET is correct, more readable. --- src/rygel/rygel-http-get.vala | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rygel/rygel-http-get.vala b/src/rygel/rygel-http-get.vala index 8a02a25..1530c23 100644 --- a/src/rygel/rygel-http-get.vala +++ b/src/rygel/rygel-http-get.vala @@ -125,27 +125,27 @@ internal class Rygel.HTTPGet : HTTPRequest { private void ensure_correct_mode () throws HTTPRequestError { var mode = this.msg.request_headers.get_one (TRANSFER_MODE_HEADER); - var incorrect = false; + var correct = true; switch (mode) { case "Streaming": - incorrect = this.handler is HTTPIdentityHandler && - (!this.item.should_stream () || - this.subtitle != null || - this.thumbnail != null); + correct = this.handler is HTTPTranscodeHandler || + (this.item.should_stream () && + this.subtitle == null && + this.thumbnail == null); break; case "Interactive": case "Background": - incorrect = this.handler is HTTPTranscodeHandler || - (this.item.should_stream () && - this.subtitle == null && - this.thumbnail == null); + correct = this.handler is HTTPIdentityHandler && + (!this.item.should_stream () || + this.subtitle != null || + this.thumbnail != null); break; } - if (incorrect) { + if (!correct) { throw new HTTPRequestError.UNACCEPTABLE ( "%s mode not supported for '%s'", mode, -- 2.7.4