# HG changeset patch # User Matti Hamalainen # Date 1315837253 -10800 # Node ID 6f4bfd8e94479572094a0787a332ea71e5c28a5f # Parent a9a4456eb2137a707afff102e6c177de38bfd542 urllog: Reorder code and make it simpler by removing duplicate checks. diff -r a9a4456eb213 -r 6f4bfd8e9447 urllog.tcl --- a/urllog.tcl Mon Sep 12 17:20:16 2011 +0300 +++ b/urllog.tcl Mon Sep 12 17:20:53 2011 +0300 @@ -430,18 +430,15 @@ set urlStr [string map $urllog_httprep $urlStr] + ### Does the URL already exist? + if {![urllog_exists $urlStr $urlNick $urlHost $urlChan]} { + return 1 + } ### Do we perform additional optional checks? - if {$urllog_check == 0 || [string range $urlStr 0 4] != "http:"} { + if {$urllog_check == 0 || [string range $urlStr 0 3] != "http"} { # No optional checks, just add the URL, if it does not exist already - if {[urllog_exists $urlStr $urlNick $urlHost $urlChan]} { - urllog_addurl $urlStr $urlNick $urlHost $urlChan "" - } - return 1 - } - - ### Does the URL already exist? - if {![urllog_exists $urlStr $urlNick $urlHost $urlChan]} { + urllog_addurl $urlStr $urlNick $urlHost $urlChan "" return 1 }