From ff837aa943ab1dce6f920a5ce6dd328ceda81860 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Mon, 2 Sep 2019 15:24:09 +0200
Subject: [PATCH] Don't use extra variable for one-time use.
---
app/static/js/CorpusList.js | 5 ++---
app/static/js/JobList.js | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/app/static/js/CorpusList.js b/app/static/js/CorpusList.js
index 5bfbe09e..8687b8d4 100644
--- a/app/static/js/CorpusList.js
+++ b/app/static/js/CorpusList.js
@@ -16,7 +16,7 @@ class CorpusList extends List {
_update(patch) {
- var item, operation, pathArray, valueName;
+ var item, operation, pathArray;
for (operation of patch) {
/* "/corpusId/valueName" -> ["corpusId", "valueName"] */
@@ -33,8 +33,7 @@ class CorpusList extends List {
break;
case "replace":
item = this.get("id", pathArray[0])[0];
- valueName = pathArray[1];
- switch(valueName) {
+ switch(pathArray[1]) {
case "description":
item.values({"description": operation.value});
break;
diff --git a/app/static/js/JobList.js b/app/static/js/JobList.js
index 215bde3e..03420265 100644
--- a/app/static/js/JobList.js
+++ b/app/static/js/JobList.js
@@ -17,7 +17,7 @@ class JobList extends List {
_update(patch) {
var item, jobStatusElement, newStatusColor, operation, pathArray, status,
- statusColor, valueName;
+ statusColor;
for (operation of patch) {
/* "/jobId/valueName" -> ["jobId", "valueName"] */
@@ -34,8 +34,7 @@ class JobList extends List {
break;
case "replace":
item = this.get("id", pathArray[0])[0];
- valueName = pathArray[1];
- switch(valueName) {
+ switch(pathArray[1]) {
case "description":
item.values({"description": operation.value});
break;