From 90339f2b7131a06735283fcebd83083144dbf5b0 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Fri, 14 Jun 2013 12:28:48 +0400 Subject: [PATCH] [REFACTOR] sspt_proc_find_file_or_new() --- us_manager/sspt/sspt_proc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/us_manager/sspt/sspt_proc.c b/us_manager/sspt/sspt_proc.c index fa3cb5b..5d5aec6 100644 --- a/us_manager/sspt/sspt_proc.c +++ b/us_manager/sspt/sspt_proc.c @@ -131,15 +131,12 @@ struct sspt_file *sspt_proc_find_file_or_new(struct sspt_proc *proc, { struct sspt_file *file; - list_for_each_entry(file, &proc->file_list, list) { - if (file->dentry == dentry) { - return file; - } + file = sspt_proc_find_file(proc, dentry); + if (file == NULL) { + file = sspt_file_create(name, dentry, 10); + sspt_proc_add_file(proc, file); } - file = sspt_file_create(name, dentry, 10); - sspt_proc_add_file(proc, file); - return file; } -- 2.7.4