Skip to content

Commit

Permalink
better memory efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
cnmicha committed Mar 10, 2017
1 parent f9e0c86 commit 437009e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lazarus/DBConnection.pas
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ TDBConnection = class
// updateInserts student object into database. Either updates an existing one or inserts a new one
// parameter: student object
// result: TRUE on success
function updateInsertStudent(student: TStudent): boolean;
function updateInsertStudent(var student: TStudent): boolean;

// Deletes a student and destroys the object
// parameter: student object
Expand All @@ -77,13 +77,13 @@ TDBConnection = class
// Returns an array of all rentals with given student and book
// parameter: student, book
// result: array of rental objects
function getAllRentalsByBookAndStudent(student: TStudent;
book: TBook): ArrayOfRentals;
function getAllRentalsByBookAndStudent(var student: TStudent;
var book: TBook): ArrayOfRentals;

// updateInserts rental object into database. Either updates an existing one or inserts a new one
// parameter: rental object
// result: TRUE on success
function updateInsertRental(rental: TRental): boolean;
function updateInsertRental(var rental: TRental): boolean;

// Deletes a rental and destroys the object
// parameter: rental object
Expand Down Expand Up @@ -111,7 +111,7 @@ TDBConnection = class
// updateInserts book object into database. Either updates an existing one or inserts a new one
// parameter: book object
// result: TRUE on success
function updateInsertBook(book: TBook): boolean;
function updateInsertBook(var book: TBook): boolean;

// Deletes a book and destroys the object
// parameter: book object
Expand All @@ -126,16 +126,16 @@ TDBConnection = class
// result: array of booktype objects
function getBooktypes: ArrayOfBooktypes;

// updateInserts booktype object into database. Either updates an existing one or inserts a new one
// parameter: booktype object
// result: TRUE on success
function updateInsertBooktype(booktype: TBooktype): boolean;

// Returns the Booktype of an ISBN Number
// parameter: Isbn (String type)
// result: TBooktype on success, NIL on failure
function getBooktypeByIsbn(isbn: string): TBooktype;

// updateInserts booktype object into database. Either updates an existing one or inserts a new one
// parameter: booktype object
// result: TRUE on success
function updateInsertBooktype(var booktype: TBooktype): boolean;

// Deletes a booktype and destroys the object
// parameter: booktype object
// result: TRUE on success
Expand Down Expand Up @@ -399,7 +399,7 @@ function TDBConnection.getStudentByLDAPUser(ldap_user: string): TStudent;
Result := arr[0];
end;

function TDBConnection.updateInsertStudent(student: TStudent): boolean;
function TDBConnection.updateInsertStudent(var student: TStudent): boolean;
begin
DBError := nil;
SQLQuery.Close;
Expand Down Expand Up @@ -536,8 +536,8 @@ function TDBConnection.getRentals: ArrayOfRentals;
setRentalFields(Result, False);
end;

function TDBConnection.getAllRentalsByBookAndStudent(student: TStudent;
book: TBook): ArrayOfRentals;
function TDBConnection.getAllRentalsByBookAndStudent(var student: TStudent;
var book: TBook): ArrayOfRentals;
begin
DBError := nil;
SQLQuery.Close;
Expand Down Expand Up @@ -565,7 +565,7 @@ function TDBConnection.getAllRentalsByBookAndStudent(student: TStudent;
setRentalFields(Result, False);
end;

function TDBConnection.updateInsertRental(rental: TRental): boolean;
function TDBConnection.updateInsertRental(var rental: TRental): boolean;
begin
DBError := nil;
SQLQuery.Close;
Expand Down Expand Up @@ -760,7 +760,7 @@ function TDBConnection.getBookById(id: longint): TBook;
Result := arr[0];
end;

function TDBConnection.updateInsertBook(book: TBook): boolean;
function TDBConnection.updateInsertBook(var book: TBook): boolean;
begin
DBError := nil;
SQLQuery.Close;
Expand Down Expand Up @@ -887,7 +887,7 @@ function TDBConnection.getBooktypes: ArrayOfBooktypes;
setBooktypeFields(Result, False);
end;

function TDBConnection.updateInsertBooktype(booktype: TBooktype): boolean;
function TDBConnection.updateInsertBooktype(var booktype: TBooktype): boolean;
begin
DBError := nil;
SQLQuery.Close;
Expand Down

0 comments on commit 437009e

Please sign in to comment.