hash = object in JS

This commit is contained in:
jomo 2015-01-28 23:49:23 +01:00
parent c75c46aa9d
commit dda4821b8e

View File

@ -110,7 +110,7 @@ function callback_for(uuid, type, err, hash) {
} }
} }
function array_has_hash(arr, property, value) { function array_has_obj(arr, property, value) {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (arr[i][property] === value) { if (arr[i][property] === value) {
return true; return true;
@ -126,7 +126,7 @@ function store_images(uuid, details, type, callback) {
type: type, type: type,
callback: callback callback: callback
}; };
if (!array_has_hash(currently_running, "uuid", uuid)) { if (!array_has_obj(currently_running, "uuid", uuid)) {
currently_running.push(new_hash); currently_running.push(new_hash);
networking.get_profile((is_uuid ? uuid : null), function(err, profile) { networking.get_profile((is_uuid ? uuid : null), function(err, profile) {
if (err || (is_uuid && !profile)) { if (err || (is_uuid && !profile)) {