Reihenfolge innerhalb der structs so verändert, dass möglichst wenige Pointerbytes verwendet werden.

This commit is contained in:
Jason Streifling 2024-01-06 17:05:06 +01:00
parent c607b837b9
commit 3cfcb721e8
2 changed files with 11 additions and 11 deletions

View File

@ -18,38 +18,38 @@ type DB struct {
} }
type Person struct { type Person struct {
ID int64
FirstName string FirstName string
LastName string LastName string
ID int64
} }
type Instructor Person type Instructor Person
type Participant struct { type Participant struct {
Person
Company string Company string
Person
} }
type Briefing struct { type Briefing struct {
ID int64
DateTime string DateTime string
Location string Location string
Document string Document string
AsOf string AsOf string
InstructorID int64 InstructorID int64
ID int64
} }
type Answer struct { type Answer struct {
ID int64
Text string Text string
IsImage bool // TODO: relocate to sessionStructs if possible IsImage bool // TODO: relocate to sessionStructs if possible
ID int64
} }
type Question struct { type Question struct {
ID int64
Text string Text string
Answers []Answer Answers []Answer
Correct int Correct int
ID int64
} }
type GivenAnswer struct { type GivenAnswer struct {

View File

@ -17,27 +17,27 @@ import (
) )
type tableHTMLData struct { type tableHTMLData struct {
SessionID uuid.UUID
OTD []data.OverviewTableData OTD []data.OverviewTableData
SessionID uuid.UUID
} }
type participantHTMLData struct { type participantHTMLData struct {
BriefingID uuid.UUID
Participant Participant
BriefingID uuid.UUID
} }
type questionHTMLData struct { type questionHTMLData struct {
Question data.Question
participantHTMLData participantHTMLData
QuestionID int64 QuestionID int64
Question data.Question
} }
type resultAnswer struct { type resultAnswer struct {
ID int64
Text string Text string
Correct bool Correct bool
Chosen bool Chosen bool
IsImage bool // TODO: relocate to sessionStructs if possible IsImage bool // TODO: relocate to sessionStructs if possible
ID int64
} }
type resultQuestion struct { type resultQuestion struct {
@ -46,12 +46,12 @@ type resultQuestion struct {
} }
type resultHTMLData struct { type resultHTMLData struct {
participantHTMLData
Questions []resultQuestion Questions []resultQuestion
participantHTMLData
} }
type summaryHTMLData struct { type summaryHTMLData struct {
ParticipantsData []participantHTMLData
SessionID uuid.UUID SessionID uuid.UUID
BriefingID uuid.UUID BriefingID uuid.UUID
ParticipantsData []participantHTMLData
} }