# HG changeset patch # User jbe # Date 1448987433 -3600 # Node ID b79085a2f92edfe0a0a0c371776a81b8ab0e802b # Parent ebb3c5fa158d14f801959ceafa1ff53c474afa74 Minor code cleanup in app/main/draft/diff.lua diff -r ebb3c5fa158d -r b79085a2f92e app/main/draft/diff.lua --- a/app/main/draft/diff.lua Tue Dec 01 16:43:54 2015 +0100 +++ b/app/main/draft/diff.lua Tue Dec 01 17:30:33 2015 +0100 @@ -19,9 +19,7 @@ end if old_draft_id > new_draft_id then - local tmp = old_draft_id - old_draft_id = new_draft_id - new_draft_id = tmp + old_draft_id, new_draft_id = new_draft_id, old_draft_id end local old_draft = Draft:by_id(old_draft_id) @@ -71,7 +69,7 @@ local old_draft_content = string.gsub(string.gsub(old_draft.content, "\n", " ###ENTER###\n"), " ", "\n") local new_draft_content = string.gsub(string.gsub(new_draft.content, "\n", " ###ENTER###\n"), " ", "\n") -local key = multirand.string(26, "123456789bcdfghjklmnpqrstvwxyz"); +local key = multirand.string(24, "0123456789abcdefghijklmnopqrstuvwxyz") local old_draft_filename = encode.file_path(request.get_app_basepath(), 'tmp', "diff-" .. key .. "-old.tmp") local new_draft_filename = encode.file_path(request.get_app_basepath(), 'tmp', "diff-" .. key .. "-new.tmp") @@ -207,4 +205,4 @@ end end ) -end ) \ No newline at end of file +end )