diff --git a/infer/src/IR/SourceFiles.ml b/infer/src/IR/SourceFiles.ml index ed5855f9d..c5ec6b662 100644 --- a/infer/src/IR/SourceFiles.ml +++ b/infer/src/IR/SourceFiles.ml @@ -82,7 +82,7 @@ let get_all () = let db = ResultsDatabase.get_database () in Sqlite3.prepare db "SELECT source_file FROM source_files" |> SqliteUtils.sqlite_result_rev_list_step db ~log:"getting all source files" - |> List.filter_map ~f:(Option.map ~f:SourceFile.SQLite.deserialize) + |> List.map ~f:SourceFile.SQLite.deserialize let load_proc_names_statement = diff --git a/infer/src/base/SqliteUtils.ml b/infer/src/base/SqliteUtils.ml index db43fd59c..bc6fc7420 100644 --- a/infer/src/base/SqliteUtils.ml +++ b/infer/src/base/SqliteUtils.ml @@ -40,7 +40,7 @@ let sqlite_result_rev_list_step ?finalize:(do_finalize = true) db ~log stmt = match Sqlite3.step stmt with | Sqlite3.Rc.ROW -> (* the operation returned a result, get it *) - let value = Some (Sqlite3.column stmt 0) in + let value = Sqlite3.column stmt 0 in aux (value :: rev_results) | DONE -> rev_results @@ -56,7 +56,7 @@ let sqlite_result_step ?finalize db ~log stmt = | [] -> None | [x] -> - x + Some x | l -> L.die InternalError "%s: zero or one result expected, got %d instead" log (List.length l) diff --git a/infer/src/base/SqliteUtils.mli b/infer/src/base/SqliteUtils.mli index 9032c0219..c19f58c52 100644 --- a/infer/src/base/SqliteUtils.mli +++ b/infer/src/base/SqliteUtils.mli @@ -20,7 +20,7 @@ val finalize : Sqlite3.db -> log:string -> Sqlite3.stmt -> unit (** Finalize the given [stmt]. Raises [Error] on failure. *) val sqlite_result_rev_list_step : - ?finalize:bool -> Sqlite3.db -> log:string -> Sqlite3.stmt -> Sqlite3.Data.t option list + ?finalize:bool -> Sqlite3.db -> log:string -> Sqlite3.stmt -> Sqlite3.Data.t list (** Return a reversed list of results obtained by repeatedly stepping through [stmt] and saving only column 0 of each returned row (all that's been needed so far). *) val sqlite_result_step :