From 33f0e967bbd1875c29d44bff97dc35712a454c0c Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Sep 2017 16:03:03 +0200 Subject: [PATCH] No more lightdb:delete v2 --- build/lightdb/core/lightdb.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/lightdb/core/lightdb.php b/build/lightdb/core/lightdb.php index 7910be1..7aaf32e 100644 --- a/build/lightdb/core/lightdb.php +++ b/build/lightdb/core/lightdb.php @@ -114,9 +114,11 @@ * */ public function insert($key, $data){ + $already_line = $this->line; + /* (1) On vérifie que la clé est unique */ - // if( array_key_exists($key, $this->index) ) - // return true; + if( !array_key_exists($key, $this->index) ){ + $already_line = $this->index[$key]['line']; $key = (string) $key;