liquid_feedback_frontend
changeset 1226:b79085a2f92e
Minor code cleanup in app/main/draft/diff.lua
author | jbe |
---|---|
date | Tue Dec 01 17:30:33 2015 +0100 (2015-12-01) |
parents | ebb3c5fa158d |
children | e0235b3d19ee |
files | app/main/draft/diff.lua |
line diff
1.1 --- a/app/main/draft/diff.lua Tue Dec 01 16:43:54 2015 +0100 1.2 +++ b/app/main/draft/diff.lua Tue Dec 01 17:30:33 2015 +0100 1.3 @@ -19,9 +19,7 @@ 1.4 end 1.5 1.6 if old_draft_id > new_draft_id then 1.7 - local tmp = old_draft_id 1.8 - old_draft_id = new_draft_id 1.9 - new_draft_id = tmp 1.10 + old_draft_id, new_draft_id = new_draft_id, old_draft_id 1.11 end 1.12 1.13 local old_draft = Draft:by_id(old_draft_id) 1.14 @@ -71,7 +69,7 @@ 1.15 local old_draft_content = string.gsub(string.gsub(old_draft.content, "\n", " ###ENTER###\n"), " ", "\n") 1.16 local new_draft_content = string.gsub(string.gsub(new_draft.content, "\n", " ###ENTER###\n"), " ", "\n") 1.17 1.18 -local key = multirand.string(26, "123456789bcdfghjklmnpqrstvwxyz"); 1.19 +local key = multirand.string(24, "0123456789abcdefghijklmnopqrstuvwxyz") 1.20 1.21 local old_draft_filename = encode.file_path(request.get_app_basepath(), 'tmp', "diff-" .. key .. "-old.tmp") 1.22 local new_draft_filename = encode.file_path(request.get_app_basepath(), 'tmp', "diff-" .. key .. "-new.tmp") 1.23 @@ -207,4 +205,4 @@ 1.24 end 1.25 1.26 end ) 1.27 -end ) 1.28 \ No newline at end of file 1.29 +end )